[AutoPR azure-ai-contentsafety]-generated-from-SDK Generation - Python-6652880 - #48375
[AutoPR azure-ai-contentsafety]-generated-from-SDK Generation - Python-6652880#48375azure-sdk-automation[bot] wants to merge 14 commits into
Conversation
…fig.yaml', API Version: 2026-07-01-preview, SDK Release Type: beta, and CommitSHA: '829ccecea7e9c1609881104b9a8d0f8cb65ce644' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6640811 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
|
Azure Pipelines: Successfully started running 1 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot could not run the full agentic suite for this review because it was automatically requested on a bot-authored pull request. Request a review from Copilot under Reviewers to retry with the full agentic suite. Improved support for bot-authored pull requests is coming soon.
Updates the azure-ai-contentsafety Python SDK to a newer REST spec commit and regenerates the client to include new preview APIs (Content Provenance, Shield Prompt, protected material), along with modernized packaging metadata.
Changes:
- Bumps generated code/spec commit and package version to
1.1.0b1, adding Content Provenance Detection, Shield Prompt, and protected-material APIs. - Migrates packaging from
setup.py/sdk_packaging.tomlto PEP 621pyproject.tomland updates dependencies / supported Python versions. - Adds generated samples/tests plus new sanitizer setup for recordings.
Reviewed changes
Copilot reviewed 62 out of 63 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/contentsafety/azure-ai-contentsafety/tsp-location.yaml | Updates swagger/spec commit reference; adjusts additional directory config. |
| sdk/contentsafety/azure-ai-contentsafety/tests/conftest.py | Minor formatting change in test proxy fixture file. |
| sdk/contentsafety/azure-ai-contentsafety/setup.py | Removes legacy setuptools build script (migration to pyproject). |
| sdk/contentsafety/azure-ai-contentsafety/sdk_packaging.toml | Removes old packaging config (moved into pyproject). |
| sdk/contentsafety/azure-ai-contentsafety/samples/sample_manage_blocklist.py | Adds pylint disables for generated-sample linting. |
| sdk/contentsafety/azure-ai-contentsafety/pyproject.toml | Introduces PEP 621 metadata / build-system; moves packaging config. |
| sdk/contentsafety/azure-ai-contentsafety/generated_tests/testpreparer_async.py | Adds generated async test base/preparer helpers. |
| sdk/contentsafety/azure-ai-contentsafety/generated_tests/testpreparer.py | Adds generated sync test base/preparer helpers. |
| sdk/contentsafety/azure-ai-contentsafety/generated_tests/test_content_safety_async.py | Adds generated async tests (currently skipped). |
| sdk/contentsafety/azure-ai-contentsafety/generated_tests/test_content_safety.py | Adds generated sync tests (currently skipped). |
| sdk/contentsafety/azure-ai-contentsafety/generated_tests/test_content_provenance_async.py | Adds generated async tests for provenance APIs (skipped). |
| sdk/contentsafety/azure-ai-contentsafety/generated_tests/test_content_provenance.py | Adds generated sync tests for provenance APIs (skipped). |
| sdk/contentsafety/azure-ai-contentsafety/generated_tests/test_blocklist_async.py | Adds generated async tests for blocklist APIs (skipped). |
| sdk/contentsafety/azure-ai-contentsafety/generated_tests/test_blocklist.py | Adds generated sync tests for blocklist APIs (skipped). |
| sdk/contentsafety/azure-ai-contentsafety/generated_tests/conftest.py | Adds sanitizer/test-proxy setup for generated recordings. |
| sdk/contentsafety/azure-ai-contentsafety/generated_samples/shield_prompt.py | Adds generated sample for Shield Prompt API. |
| sdk/contentsafety/azure-ai-contentsafety/generated_samples/remove_blocklist_items.py | Adds generated sample for removing blocklist items. |
| sdk/contentsafety/azure-ai-contentsafety/generated_samples/provenance_get_operation_status.py | Adds generated sample for querying provenance LRO status. |
| sdk/contentsafety/azure-ai-contentsafety/generated_samples/provenance_detect.py | Adds generated sample for starting provenance detection LRO. |
| sdk/contentsafety/azure-ai-contentsafety/generated_samples/list_text_blocklists.py | Adds generated sample for listing blocklists. |
| sdk/contentsafety/azure-ai-contentsafety/generated_samples/list_text_blocklist_items.py | Adds generated sample for listing blocklist items. |
| sdk/contentsafety/azure-ai-contentsafety/generated_samples/get_text_blocklist_item.py | Adds generated sample for fetching a blocklist item. |
| sdk/contentsafety/azure-ai-contentsafety/generated_samples/get_text_blocklist.py | Adds generated sample for fetching a blocklist. |
| sdk/contentsafety/azure-ai-contentsafety/generated_samples/detect_text_protected_material.py | Adds generated sample for protected-material detection API. |
| sdk/contentsafety/azure-ai-contentsafety/generated_samples/delete_text_blocklist.py | Adds generated sample for deleting a blocklist. |
| sdk/contentsafety/azure-ai-contentsafety/generated_samples/create_or_update_text_blocklist.py | Adds generated sample for creating/updating a blocklist. |
| sdk/contentsafety/azure-ai-contentsafety/generated_samples/analyze_text.py | Adds generated sample for text analysis API. |
| sdk/contentsafety/azure-ai-contentsafety/generated_samples/analyze_image.py | Adds generated sample for image analysis API. |
| sdk/contentsafety/azure-ai-contentsafety/generated_samples/add_or_update_blocklist_items.py | Adds generated sample for adding/updating blocklist items. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py | Adds TypedDict request/shape types for the public surface. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/models/_patch.py | Updates patch header and __all__ typing style. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/models/_models.py | Regenerates models, adds provenance + shield/protected-material models, migrates model base/util imports. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/models/_enums.py | Adds provenance/polling enums; improves enum docstrings. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/models/init.py | Exposes new models/enums and updates import/patch mechanics. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_vendor.py | Removes legacy typing-only vendor mixins (replaced by shared utils). |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_patch.py | Updates patch header and __all__ typing style. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_operations/_patch.py | Updates patch header and __all__ typing style. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_operations/_operations.py | Adds provenance/shield/protected-material ops; refactors mixins and streaming/decompression handling. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_operations/init.py | Updates exports/import pattern for operations mixins. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_configuration.py | Adds ContentProvenance config; updates api version defaults. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_client.py | Adds async ContentProvenanceClient and refactors mixin inheritance; adds Self typing. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/init.py | Exposes ContentProvenanceClient from aio namespace. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_version.py | Bumps package version to 1.1.0b1. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_vendor.py | Removes legacy typing-only vendor mixins (replaced by shared utils). |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_validation.py | Adds API-version gating decorator used by new preview operations. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_utils/utils.py | Adds shared internal ClientMixin ABC to replace vendor files. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_utils/init.py | Adds utils package init for internal helpers. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_patch.py | Updates patch header and __all__ typing style. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_operations/_patch.py | Updates patch header and __all__ typing style. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_operations/init.py | Updates exports/import pattern for operations mixins. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_model_base.py | Removes legacy model base implementation (replaced by new utils model base). |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_configuration.py | Adds ContentProvenance config; updates api version defaults. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_client.py | Adds sync ContentProvenanceClient and refactors mixin inheritance; adds Self typing. |
| sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/init.py | Exposes ContentProvenanceClient from sync namespace. |
| sdk/contentsafety/azure-ai-contentsafety/apiview-properties.json | Adds APIView cross-language metadata mappings for new surface area. |
| sdk/contentsafety/azure-ai-contentsafety/api.metadata.yml | Adds API parser metadata captured during generation. |
| sdk/contentsafety/azure-ai-contentsafety/api.md | Adds regenerated API signature document for review/validation. |
| sdk/contentsafety/azure-ai-contentsafety/_metadata.json | Adds generation metadata (api version, emitter version, spec commit). |
| sdk/contentsafety/azure-ai-contentsafety/MANIFEST.in | Minor formatting update. |
| sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md | Adds 1.1.0b1 entry placeholder text. |
Comments suppressed due to low confidence (5)
sdk/contentsafety/azure-ai-contentsafety/tsp-location.yaml:1
additionalDirectories:is now an explicit null value, whereas previously it was an empty list ([]). If tooling expects a list, this can break spec resolution; set this back toadditionalDirectories: [](or provide a proper YAML list).
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:1- PEP 621
project.licenseis not a plain string; it should be a table (e.g.,license = { text = \"MIT\" }) orlicense = { file = \"LICENSE\" }. As-is, some build backends may reject this metadata.
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:1 [tool.setuptools.package-data]keys must be package names (or\"*\"), not an arbitrary label. This likely preventspy.typedfrom being included in the built wheel. Use the actual package (e.g.azure.ai.contentsafety) or\"*\"to includepy.typed.
sdk/contentsafety/azure-ai-contentsafety/generated_samples/analyze_text.py:1- Using
boolas a sample value will serialize as a Python type object and will fail JSON serialization (TypeError: Object of type type is not JSON serializable) if the sample is run. Replace with a real boolean placeholder (e.g.True/False) to keep samples runnable.
sdk/contentsafety/azure-ai-contentsafety/generated_samples/shield_prompt.py:1 - These samples construct clients with
credentialas a plain string, but the SDK expects anAzureKeyCredentialor token credential type. Update the sample to show correct credential creation (e.g.AzureKeyCredential(...)orDefaultAzureCredential()), otherwise the sample will fail at runtime.
| def decorator(func): | ||
| @functools.wraps(func) | ||
| def wrapper(*args, **kwargs): | ||
| try: | ||
| # this assumes the client has an _api_version attribute | ||
| client = args[0] | ||
| client_api_version = client._config.api_version # pylint: disable=protected-access | ||
| except AttributeError: | ||
| return func(*args, **kwargs) | ||
|
|
||
| if _index_with_default(method_added_on) > _index_with_default(client_api_version): | ||
| raise ValueError( | ||
| f"'{func.__name__}' is not available in API version " | ||
| f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." | ||
| ) | ||
|
|
||
| unsupported = { | ||
| parameter: api_version | ||
| for api_version, parameters in params_added_on.items() | ||
| for parameter in parameters | ||
| if parameter in kwargs and _index_with_default(api_version) > _index_with_default(client_api_version) | ||
| } | ||
| if unsupported: | ||
| raise ValueError( | ||
| "".join( | ||
| [ | ||
| f"'{param}' is not available in API version {client_api_version}. " | ||
| f"Use service API version {version} or newer.\n" | ||
| for param, version in unsupported.items() | ||
| ] | ||
| ) | ||
| ) | ||
| return func(*args, **kwargs) |
| """Analyze Image. | ||
|
|
||
| A synchronous API for the analysis of potentially harmful image content. Currently, it supports | ||
| four categories: Hate, SelfHarm, Sexual, and Violence. |
| ## 1.1.0b1 (2026-07-30) | ||
|
|
||
| skip changelog generation for data-plane package and please add changelog manually. |
This comment has been minimized.
This comment has been minimized.
…test_blocklist.py)
…ests/test_content_safety.py)
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 61 out of 62 changed files in this pull request and generated no new comments.
Suppressed comments (6)
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:16
- The release version is
1.1.0b1, but this metadata advertises the distribution as Production/Stable. Beta package versions in this repository useDevelopment Status :: 4 - Beta(for example,sdk/search/azure-search-documents/pyproject.toml:20), so PyPI metadata would otherwise misrepresent this release.
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:26 - This raises the minimum Python version from 3.7 to 3.10, but the new changelog entry does not disclose that 3.7–3.9 support is dropped, and
README.md:21still says Python 3.7 is supported. Update both user-facing documents so affected users are warned before upgrading.
sdk/contentsafety/azure-ai-contentsafety/generated_tests/test_content_provenance.py:14 - This class-level skip leaves both new provenance operations entirely untested; the existing package tests cover only Content Safety and Blocklist clients, while the async generated counterpart is also skipped. Add runnable sync and async coverage for starting, polling, and retrieving a provenance operation before releasing the new client.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py:201 blocklistItemIdis service-generated and read-only (the generated model also gives itvisibility=["read"]), so requiring it in this request TypedDict rejects valid request dictionaries during type checking and led the generated sample to send a fabricated ID. Exclude the read-only field from the input shape and update the generated API artifacts/sample accordingly.
sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md:12- The release also exposes the new
DetectOutcomeenum, but this enum list omits it. Include it so the release notes accurately describe the provenance API surface.
- Added enums `DetectedProvenanceType` and `ProvenanceOperationKind`.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/models/_models.py:786
- The public model documentation uses the plural “properties” after the singular article “An.” Fix the source description to “An optional property…” and regenerate so the duplicate generated docstrings stay consistent.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 61 out of 62 changed files in this pull request and generated no new comments.
Suppressed comments (5)
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:1
[tool.setuptools.package-data]keys are package names, butpytypedis not a package. This will likely preventpy.typedfrom being included in the built wheel/sdist. Use the actual package name key (e.g.,azure.ai.contentsafety) for thepy.typedentry so typing markers are shipped correctly.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/models/_models.py:1ODataV4Formatis referenced in docstrings/types asazure.core.ODataV4Format, but it's imported fromazure.core.exceptions. This is likely an import-path bug that can raiseImportErrorat runtime. ImportODataV4Formatfrom the correctazure.coremodule/path that actually defines it (and keep the annotation consistent).
sdk/contentsafety/azure-ai-contentsafety/tsp-location.yaml:1additionalDirectories:is now present without a value, which parses asnull(not a list). Tooling that expects a list (previously[]) can break. Set it explicitly to an empty list (additionalDirectories: []) or provide the intended list values.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py:1- The TypedDict field is named
blocklistItems, but the docstring documentsblocklist_items. This mismatch makes the public typing/docs confusing. Update the docstring to document the actual key name(s) supported by the TypedDict (blocklistItems, and optionally any snake_case alias if intentionally supported).
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_validation.py:36 api_version_validationalways wraps with a syncdef wrapper, even when decoratingasync defAPIs. When stacked with@distributed_trace_async, this can break coroutine detection/async tracing behavior because the wrapped callable is no longer aniscoroutinefunction. Consider generating anasync def wrapperwhenfuncis async (e.g., viainspect.iscoroutinefunction(func)) andawait func(...)to preserve async semantics and tracing compatibility.
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
try:
# this assumes the client has an _api_version attribute
client = args[0]
client_api_version = client._config.api_version # pylint: disable=protected-access
This comment has been minimized.
This comment has been minimized.
…minimum in CHANGELOG
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 61 out of 62 changed files in this pull request and generated no new comments.
Suppressed comments (3)
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:16
- This release is explicitly beta and
_version.pysets1.1.0b1, but this classifier advertises the distribution as production/stable on package indexes. Use the Beta classifier, as other beta packages do (for examplesdk/search/azure-search-documents/pyproject.toml:20andsdk/identity/azure-identity/pyproject.toml:15).
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py:201 blocklistItemIdis server-generated and read-only in the source contract, yet this requestTypedDictmakes it required. Consequently, the dictionary overload cannot type-check the valid create shape used by the existing model-based tests without supplying a read-only value, and plain dictionaries will serialize that value instead of filtering it. Generate a request shape that omits this read-only property (and refresh the derived API snapshot/samples).
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_client.py:120- The maintained test suite covers the existing clients but has no executable coverage for this new provenance client or its LRO behavior. Add sync coverage for
begin_detect/polling andget_operation_status(and async coverage where supported), including response deserialization and failure paths, before releasing the new API.
class ContentProvenanceClient(_ContentProvenanceClientOperationsMixin):
This comment has been minimized.
This comment has been minimized.
…fig.yaml', SDK Release Type: beta, and CommitSHA: '926fc28f53c318fe3cf68eb8be1ea38e658c0879' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6652880 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.
Pull request overview
Copilot reviewed 63 out of 64 changed files in this pull request and generated no new comments.
Suppressed comments (9)
sdk/contentsafety/azure-ai-contentsafety/tsp-location.yaml:1
additionalDirectories:is currently set to an empty/null value, which is likely invalid for the tooling that expects a list (previously[]). Set it explicitly to an empty list (additionalDirectories: []) or remove the key entirely to avoid YAML parsing/consumer errors.
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:1- The PEP 621
licensefield is expected to be a table (e.g.,license = { text = \"MIT\" }orlicense = { file = \"LICENSE\" }). Using a bare string may be rejected by strict build backends/validators and can break packaging in some environments.
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:1 [tool.setuptools.package-data]keys should be importable package names (or*), not an arbitrary label. As written,py.typedlikely will not be included in the wheel forazure.ai.contentsafety, which breaks PEP 561 typing. Use a package key likeazure.ai.contentsafety = [\"py.typed\"](or equivalent) so the marker file is packaged.
sdk/contentsafety/azure-ai-contentsafety/generated_tests/test_content_safety.py:1- All newly added generated tests are marked
@pytest.mark.skip(...), so the new/updated API surface is not exercised in CI. If these tests are intended to validate this PR, remove the skip and replace placeholder inputs/assertions with real test cases (or add separate non-skipped tests covering the new operations).
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py:1 - The docstring refers to
blocklist_items, but the actual TypedDict key isblocklistItems. Similar snake_case vs camelCase mismatches appear elsewhere intypes.pyand can easily lead users to send the wrong JSON keys. Update the:ivar/:vartypedocs to match the actual keys (or add explicit snake_case aliases + a conversion layer if snake_case is intended to be supported).
sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md:5 - This entry reads like an internal instruction rather than user-facing release notes. Replace it with a short bullet list of customer-relevant changes (e.g., new APIs added: Content Provenance, Shield Prompt, protected material detection; packaging migration; etc.).
## 1.1.0b1 (2026-08-03)
skip changelog generation for data-plane package and please add changelog manually.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_operations/_operations.py:1274
- On error, the response body is not consumed/closed. In the Azure Core pipeline, not reading the body can prevent connection reuse and cause resource leaks under load. Align this with other methods in this file by reading the response on failures (ideally handling
StreamConsumedError/StreamClosedErroras done elsewhere).
response = pipeline_response.http_response
if response.status_code not in [204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response)
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_operations/_operations.py:1743
- Same issue as
delete_text_blocklist: on error the response body isn't consumed/closed, which can hurt connection pooling and reliability. Read the body before raising to ensure the transport can reuse the connection.
response = pipeline_response.http_response
if response.status_code not in [204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response)
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_validation.py:38
api_version_validationwraps methods with a synchronousdef wrapper(...), even when decoratingasync deffunctions. While returning a coroutine still works, it breaksinspect.iscoroutinefunction(func)and can confuse tooling/middleware that relies on coroutine detection. Consider emitting anasync def wrapper(...)whenfuncis a coroutine function (and a sync wrapper otherwise).
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
try:
# this assumes the client has an _api_version attribute
client = args[0]
client_api_version = client._config.api_version # pylint: disable=protected-access
except AttributeError:
return func(*args, **kwargs)
This comment has been minimized.
This comment has been minimized.
…test_blocklist.py)
…ests/test_content_safety.py)
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 61 out of 62 changed files in this pull request and generated no new comments.
Suppressed comments (7)
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:20
- The release version is
1.1.0b1and the PR is explicitly a beta release, but this classifier publishes it as Production/Stable. Beta packages useDevelopment Status :: 4 - Beta(for example,sdk/cognitivelanguage/azure-ai-language-conversations/pyproject.toml:20with version2.0.0b2), so this metadata should be aligned to avoid misrepresenting the release on package indexes.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_operations/_operations.py:812 AsyncNoPollinguses this callback with the initial 202 response whenpolling=False. The service's initial payload has noresult, so this returns an invalidDetectProvenanceResultmissing requiredoutcome; handle the initial status explicitly before deserializing the final nested result.
deserialized = _deserialize(_models.DetectProvenanceResult, response.json().get("result", {}))
sdk/contentsafety/azure-ai-contentsafety/generated_tests/test_content_provenance.py:13
- This skips the only added synchronous tests for
ContentProvenanceClient, and the bodies contain no assertions. Convert these placeholders into executable recorded tests so the new initial 202 response, polling, final result deserialization, and status operation are covered.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py:124 ImageData.contentis abytesproperty in the source TypeSpec and in the generated model, and the generated dictionary sample passesbytes, but this publicTypedDictdeclares it asstr. Type checkers will therefore reject the supported dictionary form ofanalyze_image; regenerate/customize this annotation asbytesand refresh the API snapshot.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_operations/_operations.py:1146- When
polling=False,NoPollinginvokes this callback on the initial 202 response. That response containsidandstatusbut noresult, so this produces an invalidDetectProvenanceResultwith its requiredoutcomemissing. Handle the 202 initial response explicitly (normally returning no final result) before deserializing the nested result, and cover the no-polling path.
deserialized = _deserialize(_models.DetectProvenanceResult, response.json().get("result", {}))
sdk/contentsafety/azure-ai-contentsafety/generated_tests/test_content_provenance_async.py:14
- The async provenance test class is entirely skipped and has no assertions, leaving the new async LRO and status operation without executable coverage. Replace the generated placeholders with recorded tests, including the initial and final polling responses.
sdk/contentsafety/azure-ai-contentsafety/generated_tests/test_content_safety_async.py:14 - This class contains the only added tests for
detect_text_protected_materialandshield_prompt, but the class-level skip and placeholder assertions mean neither new operation is exercised. Add executable recorded coverage for their request serialization and response models before release.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 62 out of 63 changed files in this pull request and generated no new comments.
Suppressed comments (6)
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:20
- The PR is a beta release (
1.1.0b1), but this classifier publishes it as Production/Stable. This contradicts the release type and misrepresents the package on package indexes; use the Beta classifier.
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:30 - Raising the package requirement to Python 3.10 leaves the user-facing prerequisite stale:
README.md:21still says Python 3.7 or later. Update the README in the same release so installation guidance matches package metadata.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py:200 blocklistItemIdis documented as service-generated and the source contract marks it read-only, yet this request TypedDict requires callers to provide it. That makes the dictionary overload reject valid add requests during type checking; regenerate the request shape so this field is optional or omitted.
sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md:8- This description overstates the feature as determining whether media is AI-generated. The service only detects supported Microsoft-issued C2PA or watermark signals, and absence of a signal is not proof that content was not AI-generated; use the narrower wording from the service contract.
- Added `ContentProvenanceClient`, which detects whether media was generated or modified by an AI system:
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/init.py:16
- The new
ContentProvenanceClientLRO workflow has no handwritten recorded or unit coverage intests/; the existing suite covers only ContentSafetyClient and BlocklistClient. Add sync and async tests for the initial 202 response, successful polling/result deserialization, failure handling, andget_operation_status.
from ._client import ContentProvenanceClient # type: ignore
sdk/contentsafety/azure-ai-contentsafety/api.md:276
- The handwritten
tests/test_content_safety.pycovers the existing analyze operations, but neither of the newly exposeddetect_text_protected_materialandshield_promptmethods has executable coverage. Add recorded sync/async tests that validate request serialization and response models for both operations.
def detect_text_protected_material(
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 62 out of 63 changed files in this pull request and generated no new comments.
Suppressed comments (8)
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_client.py:133
- The documented default is incorrect:
ContentProvenanceClientConfigurationsetsapi_versionto"2026-07-01-preview"when omitted, notNone. Update the public client docstring to match the constructor behavior.
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_client.py:216
- The documented default is incorrect:
BlocklistClientConfigurationsetsapi_versionto"2026-07-01-preview"when omitted, notNone. Update the public client docstring to match the constructor behavior.
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_client.py:137
- The documented default is incorrect: the async
ContentProvenanceClientConfigurationsetsapi_versionto"2026-07-01-preview"when omitted, notNone. Update the public async client docstring to match the constructor behavior.
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_client.py:224
- The documented default is incorrect: the async
BlocklistClientConfigurationsetsapi_versionto"2026-07-01-preview"when omitted, notNone. Update the public async client docstring to match the constructor behavior.
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:20
- This beta release is classified as Production/Stable, which makes the published package metadata contradict both
VERSION = "1.1.0b1"and the PR's beta release type. Preview data-plane packages use the Beta classifier (for example,sdk/contentunderstanding/azure-ai-contentunderstanding/pyproject.toml:20).
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_client.py:52 - The documented default is incorrect:
ContentSafetyClientConfigurationsetsapi_versionto"2026-07-01-preview"when omitted, notNone. Update the public client docstring so generated reference documentation describes the request version users actually receive.
This issue also appears in the following locations of the same file:
- line 130
- line 213
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_client.py:52
- The documented default is incorrect: the async
ContentSafetyClientConfigurationsetsapi_versionto"2026-07-01-preview"when omitted, notNone. Update the public async client docstring to describe the actual default.
This issue also appears in the following locations of the same file:
- line 134
- line 221
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_client.py:120
- The new provenance client and its LRO/status paths have no executable coverage: the only generated sync and async provenance tests are class-level skipped, while the maintained
tests/suite contains no provenance tests. Add runnable sync and async tests that validate request serialization, polling to the finalDetectProvenanceResult, and status/error deserialization before exposing this client.
class ContentProvenanceClient(_ContentProvenanceClientOperationsMixin):
This comment has been minimized.
This comment has been minimized.
verifysdist failed: azure-ai-contentsafety has version 1.1.0b1 and is a beta release, but has development status 'Development Status :: 5 - Production/Stable'. Expected 'Development Status :: 4 - Beta' ONLY.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 62 out of 63 changed files in this pull request and generated no new comments.
Suppressed comments (15)
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_client.py:133
- This documents
Noneas supported and as the default, but the configuration defaults to"2026-07-01-preview"; explicitly passingNonealso fails when the required query parameter is serialized. Document the actual default instead.
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_client.py:137
- This documents
Noneas supported and as the default, but the async configuration defaults to"2026-07-01-preview"; explicitly passingNonefails when serializing the required query parameter. Document the actual default instead.
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_client.py:224
- This documents
Noneas supported and as the default, but the async configuration defaults to"2026-07-01-preview"; explicitly passingNonefails when serializing the required query parameter. Document the actual default instead.
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_client.py:216
- This documents
Noneas supported and as the default, but the configuration defaults to"2026-07-01-preview"; explicitly passingNonealso fails when the required query parameter is serialized. Document the actual default instead.
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/pyproject.toml:30
- The package now requires Python 3.10, but README.md:21 still tells users that Python 3.7 is supported. Update the README prerequisite so installation guidance matches the package metadata.
sdk/contentsafety/azure-ai-contentsafety/CHANGELOG.md:12 - This list omits the newly exported
DetectOutcomeandOperationStateenums, so the release notes do not describe the full new public enum surface shown in models/init.py and api.md.
- Added enums `DetectedProvenanceType` and `ProvenanceOperationKind`.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/types.py:201
blocklistItemIdis service-generated and read-only (the TypeSpec marks itLifecycle.Read, and the model constructor intentionally does not accept it), but this request TypedDict makes it required. Type checkers therefore reject valid add-item dictionaries unless callers supply a field that should not be sent. Regenerate this request type without the read-only key.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_operations/_operations.py:1146- The initial 202 response contains only
idandstatus, with noresult. BecauseNoPolling.resource()invokes this callback forpolling=False, defaulting the missing field to{}returns an invalidDetectProvenanceResultwhose requiredoutcomeis absent. Preserve a missing result asNoneinstead of constructing an empty final model.
deserialized = _deserialize(_models.DetectProvenanceResult, response.json().get("result", {}))
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_operations/_operations.py:812
- The initial 202 response contains only
idandstatus, with noresult.AsyncNoPollinginvokes this callback forpolling=False, so the{}fallback produces an invalidDetectProvenanceResultmissing its requiredoutcome. Preserve the absent result asNone.
deserialized = _deserialize(_models.DetectProvenanceResult, response.json().get("result", {}))
sdk/contentsafety/azure-ai-contentsafety/generated_tests/test_content_provenance.py:13
- All new synchronous provenance tests are skipped and contain no assertions, while the maintained
tests/suite has no provenance coverage. Add executable tests for the initial 202 response, polling completion, status/error deserialization, andpolling=Falsebehavior before releasing the new LRO.
sdk/contentsafety/azure-ai-contentsafety/generated_tests/test_content_provenance_async.py:14 - The asynchronous provenance test class is entirely skipped and its methods have no assertions, leaving the new async client and poller behavior untested. Add executable async tests, including the initial 202 response and
polling=Falsepath.
sdk/contentsafety/azure-ai-contentsafety/generated_tests/test_content_safety_async.py:14 - This class-level skip disables all generated coverage for
shield_promptanddetect_text_protected_material, and there are no corresponding tests in the maintainedtests/directory. Add runnable sync and async tests with response assertions for both new operations.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_client.py:52 - This documents
Noneas supported and as the default, but the configuration defaults to"2026-07-01-preview"; explicitly passingNonealso fails when the required query parameter is serialized. Document the actual default instead.
This issue also appears in the following locations of the same file:
- line 130
- line 213
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_client.py:52
- This documents
Noneas supported and as the default, but the async configuration defaults to"2026-07-01-preview"; explicitly passingNonefails when serializing the required query parameter. Document the actual default instead.
This issue also appears in the following locations of the same file:
- line 134
- line 221
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/init.py:32
- The new public
ContentProvenanceClientis not mentioned in README.md's feature list, authentication examples, or examples section, which still documents onlyContentSafetyClientandBlocklistClient. Add getting-started guidance for constructing this client and runningbegin_detectso the new API is discoverable and usable.
"ContentSafetyClient",
"ContentProvenanceClient",
"BlocklistClient",
Covers both outcomes against the live service: signed media (C2PA + watermark) asserting ProvenanceDetected with a populated results array, and unsigned media asserting NoProvenanceDetected. Provenance had no executing test coverage in any language. The media are blob SAS URIs, so conftest replaces each one wholesale with a placeholder; the recordings contain neither the SAS nor the storage account name.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 64 out of 65 changed files in this pull request and generated no new comments.
Suppressed comments (8)
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_client.py:133
- The documented default is inconsistent with the implementation:
ContentProvenanceClientConfigurationdefaults this argument to"2026-07-01-preview", notNone. Update the public docstring so users know which API version is sent when they omit the argument.
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_client.py:216
- The documented default is inconsistent with the implementation:
BlocklistClientConfigurationdefaults this argument to"2026-07-01-preview", notNone. Update the public docstring so users know which API version is sent when they omit the argument.
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_client.py:137
- The documented default is inconsistent with the async configuration, which defaults this argument to
"2026-07-01-preview", notNone. Update the public docstring so users know which API version is sent when they omit the argument.
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_client.py:224
- The documented default is inconsistent with the async configuration, which defaults this argument to
"2026-07-01-preview", notNone. Update the public docstring so users know which API version is sent when they omit the argument.
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_client.py:52
- The documented default is inconsistent with the implementation:
ContentSafetyClientConfigurationdefaults this argument to"2026-07-01-preview", notNone. Update the public docstring so users know which API version is sent when they omit the argument.
This issue also appears in the following locations of the same file:
- line 130
- line 213
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_client.py:52
- The documented default is inconsistent with the async configuration, which defaults this argument to
"2026-07-01-preview", notNone. Update the public docstring so users know which API version is sent when they omit the argument.
This issue also appears in the following locations of the same file:
- line 134
- line 221
:keyword api_version: The API version to use for this operation. Known values are
"2026-07-01-preview" and None. Default value is None. If not set, the operation's default API
version will be used. Note that overriding this default value may result in unsupported
behavior.
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/_operations/_operations.py:1146
- The initial 202 response contains the operation envelope (
idandstatus) but noresult. BecauseNoPolling.resource()invokes this callback on that initial response,begin_detect(..., polling=False).result()currently returns an emptyDetectProvenanceResult, which incorrectly looks like a final result. ReturnNonewhen the envelope has no result, and deserialize only completed responses.
deserialized = _deserialize(_models.DetectProvenanceResult, response.json().get("result", {}))
sdk/contentsafety/azure-ai-contentsafety/azure/ai/contentsafety/aio/_operations/_operations.py:812
- The initial 202 response contains the operation envelope (
idandstatus) but noresult. BecauseAsyncNoPolling.resource()invokes this callback on that initial response, awaitingbegin_detect(..., polling=False).result()currently returns an emptyDetectProvenanceResult, which incorrectly looks like a final result. ReturnNonewhen the envelope has no result, and deserialize only completed responses.
deserialized = _deserialize(_models.DetectProvenanceResult, response.json().get("result", {}))
[Pilot] PR Pipeline Failure AnalysisA CI pipeline failed on this pull request. Here is an automated analysis of what went wrong and how to get the build green. What failedA single test —
The failure is reproducible across every OS and Python version, which strongly suggests a code or test issue rather than infrastructure flakiness. Recommended next steps
Raw pipeline analysis (azsdk ci analyze)
|
Configurations: 'specification/cognitiveservices/ContentSafety/tspconfig.yaml', SDK Release Type: beta, and CommitSHA: '926fc28f53c318fe3cf68eb8be1ea38e658c0879' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6652880 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. Release plan link: https://azsdk-releaseplan-dashboard-hveph5aqhhcfhtgu.westus-01.azurewebsites.net/?releaseplan=2242 Submitted by: Connor.Wood@microsoft.com