-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[AutoPR azure-mgmt-impactreporting]-generated-from-SDK Generation - Python-5237812 #42600
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
base: main
Are you sure you want to change the base?
[AutoPR azure-mgmt-impactreporting]-generated-from-SDK Generation - Python-5237812 #42600
Conversation
…l', API Version: 2024-05-01-preview, SDK Release Type: beta, and CommitSHA: '4b6264a961c730fadf866e25a0dfef17fc07557f' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5237812 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the Azure SDK for Python Impact Reporting Management Client to support a newer TypeSpec specification (commit 4b6264a961c730fadf866e25a0dfef17fc07557f). The update modernizes the SDK to align with current Azure SDK standards and includes several infrastructure improvements.
Key changes include:
- Updated Python version support (dropping 3.8, adding 3.13)
- Modernized package structure with new
_utils
directory - Updated import patterns and type annotations
- Enhanced cloud configuration support for Azure environments
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tsp-location.yaml | Updates commit hash reference to latest specification |
setup.py | Modernizes Python version requirements and dependencies |
pyproject.toml | Migrates packaging configuration from sdk_packaging.toml |
_operations.py | Updates imports, type annotations, and error handling patterns |
_models.py | Modernizes model base classes and type annotations |
_client.py | Adds cloud configuration support and modern endpoint handling |
_utils/ | New utility directory with updated serialization and model base modules |
@@ -555,7 +533,7 @@ def prepare_request(next_link=None): | |||
|
|||
def extract_data(pipeline_response): | |||
deserialized = pipeline_response.http_response.json() | |||
list_of_elem = _deserialize(List[_models.Operation], deserialized["value"]) | |||
list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is using .get("value", [])
as a fallback for potentially missing keys in the response. However, this pattern suggests the API response structure might be inconsistent. Consider documenting why this fallback is necessary or add proper error handling if the expected 'value' key is missing, as this could mask underlying API issues.
list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) | |
if "value" not in deserialized: | |
raise HttpResponseError( | |
message="Malformed response: missing 'value' key in operations list response.", | |
response=pipeline_response.http_response | |
) | |
list_of_elem = _deserialize(List[_models.Operation], deserialized["value"]) |
Copilot uses AI. Check for mistakes.
from io import IOBase | ||
import json | ||
import sys | ||
from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload | ||
from typing import Any, Callable, Dict, IO, Iterator, List, Optional, TypeVar, Union, cast, overload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import statement removes 'Iterable' from the typing imports but the code still uses 'ItemPaged' return types. While this change aligns with the new pattern using 'ItemPaged' instead of 'Iterable', ensure that all paginated operations properly return 'ItemPaged' instances rather than raw iterables to maintain consistency.
Copilot uses AI. Check for mistakes.
@@ -571,7 +549,7 @@ def get_next(next_link=None): | |||
|
|||
if response.status_code not in [200]: | |||
map_error(status_code=response.status_code, response=response, error_map=error_map) | |||
error = _failsafe_deserialize(_models.ErrorResponse, response.json()) | |||
error = _failsafe_deserialize(_models.ErrorResponse, response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _failsafe_deserialize function signature has changed to accept an HttpResponse object instead of JSON data. This change improves error handling by allowing the deserializer to access response metadata, but ensure all calling sites have been updated consistently throughout the codebase.
Copilot uses AI. Check for mistakes.
Configurations: 'specification/impact/Impact.Management/tspconfig.yaml', API Version: 2024-05-01-preview, SDK Release Type: beta, and CommitSHA: '4b6264a961c730fadf866e25a0dfef17fc07557f' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5237812 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
Release Plan Details