Skip to content

Conversation

azure-sdk
Copy link
Collaborator

@azure-sdk azure-sdk commented Aug 19, 2025

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

@praveenkuttappan praveenkuttappan marked this pull request as ready for review August 28, 2025 23:14
@Copilot Copilot AI review requested due to automatic review settings August 28, 2025 23:14
Copy link
Contributor

@Copilot Copilot AI left a 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", []))
Copy link
Preview

Copilot AI Aug 28, 2025

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.

Suggested change
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
Copy link
Preview

Copilot AI Aug 28, 2025

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)
Copy link
Preview

Copilot AI Aug 28, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant