update dict to class attr#225
Open
ryanraaschCDC wants to merge 10 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors several Azure Batch model access patterns, replacing as_dict()/dict-style fallbacks with direct attribute or mapping-style access in order to rely on class attributes instead of serialized dictionaries.
Changes:
- Updated job termination-reason extraction to use mapping-style access (
.get(...)) instead ofas_dict()fallback. - Updated pool mount configuration retrieval to use
mount_configurationattribute access rather than dict-derived values. - Removed an old commented import and added a small initializer comment in
_cloudclient.py.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
cfa/cloudops/batch_helpers.py |
Refactors job termination and pool mount/vm-size lookups away from as_dict()/dict fallbacks toward attribute access. |
cfa/cloudops/_cloudclient.py |
Refactors pool-id discovery from job_info.as_dict() to mapping-style .get(...) access; small comment cleanup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1074
to
1077
| mc = getattr(pool_info, "mount_configuration", None) | ||
| if mc is None and hasattr(pool_info, "as_dict"): | ||
| pool_dict = pool_info.as_dict() | ||
| mc = ( | ||
| pool_dict.get("mount_configuration") | ||
| or pool_dict.get("mountConfiguration") | ||
| or pool_dict.get("properties", {}).get("mountConfiguration") | ||
| or [] | ||
| ) | ||
| if mc is None: | ||
| mc = pool_info.mount_configuration or [] | ||
| mc = mc or [] |
Comment on lines
1207
to
1210
| mc = getattr(pool_info, "mount_configuration", None) | ||
| if mc is None and hasattr(pool_info, "as_dict"): | ||
| pool_dict = pool_info.as_dict() | ||
| mc = ( | ||
| pool_dict.get("mount_configuration") | ||
| or pool_dict.get("mountConfiguration") | ||
| or pool_dict.get("properties", {}).get("mountConfiguration") | ||
| or [] | ||
| ) | ||
| if mc is None: | ||
| mc = pool_info.mount_configuration or [] | ||
| mc = mc or [] |
Comment on lines
999
to
1006
| if pool_name is None: | ||
| job_dict = job_info.as_dict() | ||
| exec_dict = job_dict.get("execution_info") or job_dict.get("executionInfo") | ||
| exec_dict = job_info.get("execution_info") or job_info.get("executionInfo") | ||
| if isinstance(exec_dict, dict): | ||
| pool_name = exec_dict.get("pool_id") or exec_dict.get("poolId") | ||
| if pool_name is None: | ||
| pool_dict = job_dict.get("pool_info") or job_dict.get("poolInfo") | ||
| pool_dict = job_info.get("pool_info") or job_info.get("poolInfo") | ||
| if isinstance(pool_dict, dict): | ||
| pool_name = pool_dict.get("pool_id") or pool_dict.get("poolId") |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot stopped work on behalf of
ryanraaschCDC due to an error
July 7, 2026 17:23
Copilot stopped work on behalf of
ryanraaschCDC due to an error
July 7, 2026 17:23
Copilot stopped work on behalf of
ryanraaschCDC due to an error
July 8, 2026 16:03
Copilot stopped work on behalf of
ryanraaschCDC due to an error
July 8, 2026 16:04
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
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.
No description provided.