-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Quantum] Azure CLI leverages paginated jobs #8197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kairu-ms
merged 83 commits into
Azure:main
from
warren-jones:25267-azure-cli-leverages-paginated-jobs
Mar 6, 2025
Merged
[Quantum] Azure CLI leverages paginated jobs #8197
kairu-ms
merged 83 commits into
Azure:main
from
warren-jones:25267-azure-cli-leverages-paginated-jobs
Mar 6, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| quantum job list | cmd quantum job list added parameter created_after |
||
| quantum job list | cmd quantum job list added parameter created_before |
||
| quantum job list | cmd quantum job list added parameter item_type |
||
| quantum job list | cmd quantum job list added parameter job_name |
||
| quantum job list | cmd quantum job list added parameter job_status |
||
| quantum job list | cmd quantum job list added parameter job_type |
||
| quantum job list | cmd quantum job list added parameter order |
||
| quantum job list | cmd quantum job list added parameter orderby |
||
| quantum job list | cmd quantum job list added parameter provider_id |
||
| quantum job list | cmd quantum job list added parameter skip |
||
| quantum job list | cmd quantum job list added parameter target_id |
||
| quantum job list | cmd quantum job list added parameter top |
|
Hi @warren-jones, |
Collaborator
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
Release SuggestionsModule: quantum
Notes
|
… into the CLI extension
…ameter list - it was breaking the PR checks
…es needed -g, -w, & -l params
kairu-ms
approved these changes
Mar 6, 2025
Shivani-Msft
pushed a commit
to danlope/azure-cli-extensions
that referenced
this pull request
Mar 12, 2025
* Temporarily append '.dev1' to version number * Modified script and generated new data-plane client files * Remediated runtime errors * Added pagination params * Got missing help text to show * Pass pagination_params as kwargs to client.list * Deleted trailing whitespace to satisfy style check * Deleted experimental script * Capitalized param names sent to service * Changed target.py list return client.get_status to client.list * Adding code to construct a filter query * Added the _parse_pagination_param_values function * Added TODO and DEBUG comments in the job.py list function * Added code for more filter conditions * Fixed pylint and flake8 style violations * Deleted references to skip_token * Added orderby support * Added dictionary of job states * Temporarily added debug print statements * Removed the State-code table * Added special handling of --created-before and --created-after * Restored comment that didn't need to be changed * Added debugging code but commented it out before commit * Modified some debug code * Removed 'sorted' call in transform_jobs * Removed 'def creation(job)' in transform_jobs * Deleted commented-out code * Changed --jobs-per-page to --top * Broke out param-formatting methods to facilitate unit testing * Validates --order param * Started adding unit tests * Added tests * Changed --type to --job-type, added --item-type, and added more tests * Minor test changes * Added more tests * More tests * Modified _client_factory.py so the DP client could be used as generated * First stab at using the SDK's client files * Deleted commented-out code * Added error handling and more tests * Added comments * Revised a comment * Deleted commented-out code * Replaced eval with ast.literal_eval * Added doc link to job list error messages * Modified params in _client_factory.py * Revised comments * Extracted the first page of the response for processing: --top works! * Modified cf_providers params to work with new DP client * Added some creds debug code * Copied more of azure-quantum-python into vendored_sdks * Deleted commented-out code * Deleted commented-out code * added azure_identity and more of the SDK to vendored_sdks * Switched to target_factory.get_targets() for target list * Got target and quotas lists working * Deleted commented-out code * Removed the Python SDK files from vendored_sdks * Added test_workspace_quotas * Moved list-quotas test into test_workspace_create_destroy * Added a blank line to fix a Flake8 style violation * Added help examples * Restore commented-out test * Got the job list tests working * Restored the correct output from job submit and job show * Got 'job cancel' working again * Fixed 'azdev style' nit-picks * Deleted commented-out code * Changed case of 'InputParams' in job_details * Deleted redundant #s * SDK PR 652 has been merged: Copied the DP client files out of the SDK into the CLI extension * Job wait needs to return job.as_dict() * Modified run to handle job.as_dict() returns from submit and wait * Restored the version number (deleted the '.dev1' suffix) * Changed the job_details field names to lower camel case * Changed the azure.cli.core._profile.Profile.get_login_credentials parameter list - it was breaking the PR checks * Fixed another PR check: All the new 'az quantum job list' help examples needed -g, -w, & -l params * Saved new test recordings * Deleted old recordings and generated all new one * Added @live_only() to test_targets (for the list cmd) * Set test_jobs and test_workspace live_only
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CLI section copied from AQ Job Pagination Design.docx:
Client update required
The data-plane client files in vendored_sdks were updated after the azure-quantum-python SDK's DP client was updated in SDK PR 652: All the files from azure-quantum-python\azure-quantum\azure\quantum\_client were copied into azure-cli-extensions\src\quantum\azext_quantum\vendored_sdks\azure_quantum
No CLI-specific changes were required, so now the CLI extension and the Quantum Python SDK use identical DP client files, automatically generated with Dataplane Codegen and Typespec.
Note: The CLI wiki How to generate the control-plane and data-plane clients no longer applies to the DP client. The AutoREST/Swagger-based client generation described in the wiki now only applies to the control plane client, but that may also change when the CP client is next updated. No changes to the CP client were made for this PR.
New params for
az quantum job listRequired code changes
listfunction in job.pywith self.argument_context('quantum job list')…block in theload_argumentsfunction in _params.py, with corresponding…_typestatements at the top of that function, including help textcf_quantumfunction in _client_factory.py to accommodate DP client method name and parameter changesThis PR also includes the fix for GitHub Issue 30947: “az quantum job list - unexpected error: TypeError: Profile.get_login_credentials() got an unexpected keyword argument 'resource'”, opened 3/4/2025
Related command
az quantum job listOther commands affected by the DP client update -- no external changes expected:
az quantum job cancelaz quantum job outputaz quantum job showaz quantum job submitaz quantum job waitaz quantum runaz quantum target listaz quantum workspace quotasGeneral Guidelines
This checklist is used to make sure that common guidelines for a pull request are followed.
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)