[Search 2026-08-01-preview] python SDK codegen - #48349
[Search 2026-08-01-preview] python SDK codegen#48349efrainretana with Copilot wants to merge 13 commits into
Conversation
|
Azure Pipelines: 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
…nt codegen blocker Co-authored-by: efrainretana <141282336+efrainretana@users.noreply.github.com>
…eration Co-authored-by: efrainretana <141282336+efrainretana@users.noreply.github.com>
…en blocker Co-authored-by: efrainretana <141282336+efrainretana@users.noreply.github.com>
|
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
Regenerates azure-search-documents for API 2026-08-01-preview, adding streaming retrieval, multipart file operations, listing filters, and new models.
Changes:
- Adds the new preview API surface and makes it the default.
- Adds synchronous/asynchronous samples and tests.
- Raises minimum Python support to 3.10.
Reviewed changes
Copilot reviewed 71 out of 74 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tsp-location.yaml |
Retargets the specification commit. |
TROUBLESHOOTING.md |
Updates Azure AI Search terminology. |
tests/test_search_index_client.py |
Tests synchronous listing parameters. |
tests/test_search_index_client_async.py |
Tests asynchronous listing parameters. |
tests/test_search_client.py |
Tests the new API version. |
tests/test_knowledge_base_retrieval_client.py |
Tests synchronous SSE streaming. |
tests/test_knowledge_base_retrieval_client_retrieve_live.py |
Adds live streaming coverage. |
tests/test_knowledge_base_retrieval_client_retrieve_live_async.py |
Adds asynchronous live streaming coverage. |
tests/test_knowledge_base_retrieval_client_async.py |
Tests asynchronous SSE behavior. |
tests/_capabilities.py |
Registers new preview capabilities. |
samples/sample_knowledge_source_workiq_preview.py |
Demonstrates Work IQ authentication. |
samples/sample_knowledge_source_workiq_preview_async.py |
Adds asynchronous Work IQ usage. |
samples/sample_knowledge_source_file_preview.py |
Demonstrates multipart file operations. |
samples/sample_knowledge_source_file_preview_async.py |
Adds asynchronous multipart usage. |
samples/sample_knowledge_retrieval_response_preview.py |
Demonstrates typed streaming events. |
samples/sample_knowledge_retrieval_response_preview_async.py |
Adds asynchronous streaming usage. |
samples/sample_knowledge_base_configuration_preview.py |
Demonstrates new knowledge-base options. |
samples/sample_knowledge_base_configuration_preview_async.py |
Adds asynchronous configuration usage. |
samples/sample_index_crud.py |
Demonstrates filtered index listing. |
samples/sample_index_crud_async.py |
Adds asynchronous index listing. |
samples/README.md |
Documents updated preview samples. |
README.md |
Updates requirements and client features. |
pyproject.toml |
Raises minimum Python to 3.10. |
CHANGELOG.md |
Documents features and breaking changes. |
knowledgebases/models/_enums.py |
Adds retrieval and networking enums. |
knowledgebases/models/__init__.py |
Exports new knowledge-base models. |
knowledgebases/aio/_patch.py |
Adds typed asynchronous streaming. |
knowledgebases/aio/_operations/_operations.py |
Adds generated asynchronous retrieval operations. |
knowledgebases/aio/_configuration.py |
Updates the asynchronous preview default. |
knowledgebases/aio/_client.py |
Updates generated asynchronous client metadata. |
knowledgebases/_utils/utils.py |
Adds multipart serialization helpers. |
knowledgebases/_utils/serialization.py |
Extends generated serialization support. |
knowledgebases/_stream.py |
Implements typed SSE streams. |
knowledgebases/_patch.py |
Adds synchronous streaming support. |
knowledgebases/_operations/_operations.py |
Adds generated retrieval operations. |
knowledgebases/_configuration.py |
Updates the preview default. |
knowledgebases/_client.py |
Updates generated client metadata. |
indexes/models/_enums.py |
Adds listing and knowledge-source enums. |
indexes/models/__init__.py |
Exports new index models. |
indexes/aio/_patch.py |
Updates asynchronous client documentation. |
indexes/aio/_operations/_patch.py |
Updates asynchronous listing wrappers. |
indexes/aio/_configuration.py |
Updates asynchronous index defaults. |
indexes/aio/_client.py |
Updates generated asynchronous clients. |
indexes/_utils/utils.py |
Adds multipart serialization helpers. |
indexes/_utils/serialization.py |
Extends generated serialization support. |
indexes/_patch.py |
Updates synchronous client documentation. |
indexes/_operations/_patch.py |
Updates synchronous listing wrappers. |
indexes/_configuration.py |
Updates index client defaults. |
indexes/_client.py |
Updates generated index clients. |
aio/_patch.py |
Updates asynchronous search defaults. |
aio/_operations/_patch.py |
Updates asynchronous paging defaults. |
aio/_operations/_operations.py |
Regenerates asynchronous search operations. |
aio/_configuration.py |
Updates asynchronous search configuration. |
aio/_client.py |
Updates the generated asynchronous client. |
_utils/utils.py |
Adds shared multipart helpers. |
_utils/serialization.py |
Extends shared serialization support. |
_patch.py |
Adds and defaults the new API version. |
_operations/_patch.py |
Updates synchronous paging defaults. |
_operations/_operations.py |
Regenerates synchronous search operations. |
_configuration.py |
Updates search configuration defaults. |
_client.py |
Updates the generated search client. |
assets.json |
Updates test recording assets. |
apiview-properties.json |
Updates API-view mappings. |
_metadata.json |
Records the new API version. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
|
||
|
|
||
| DEFAULT_VERSION = ApiVersion.V2026_05_01_PREVIEW | ||
| DEFAULT_VERSION = ApiVersion.V2026_08_01_PREVIEW |
| V2025_09_01 = "2025-09-01" | ||
| V2026_04_01 = "2026-04-01" | ||
| V2026_05_01_PREVIEW = "2026-05-01-preview" | ||
| V2026_08_01_PREVIEW = "2026-08-01-preview" |
| @@ -1,4 +1,4 @@ | |||
| directory: specification/search/data-plane/Search | |||
| commit: 8be8c75d9bb11ea95d8a7e251db74aa78b5cd76c | |||
| commit: 84400eeb46c48ffe88d81e126449725508c17547 | |||
| return cast( | ||
| AsyncItemPaged[_models.SearchIndex], | ||
| self._list_indexes(search=search, page_size=page_size, search_type=search_type, **kwargs), |
| return cast( | ||
| ItemPaged[_models.SearchIndex], | ||
| self._list_indexes(search=search, page_size=page_size, search_type=search_type, **kwargs), |
Co-authored-by: efrainretana <141282336+efrainretana@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 72 out of 76 changed files in this pull request and generated 2 comments.
Suppressed comments (3)
sdk/search/azure-search-documents/tsp-location.yaml:2
- This targets
84400eeb..., while the PR description repeatedly says the package targetsc19e358...and that the namespace blocker remains. The referenced84400eebcommit is specifically the namespace-customization fix, and this PR now includes the full generated surface and samples, so the blocker/importable-subset narrative no longer describes the changes. Please update the PR description before merging.
sdk/search/azure-search-documents/azure/search/documents/_patch.py:47 - The PR description explicitly says the effective default remains
V2026_05_01_PREVIEW, but this changes omittedapi_versioncalls to use2026-08-01-preview(and the generated configurations do the same). Since this changes the wire API version for every default client, either restore the stated default or update the description to reflect the new behavior.
DEFAULT_VERSION = ApiVersion.V2026_08_01_PREVIEW
sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_operations.py:1000
- This gate makes the async selected-properties path unavailable to all older API versions, although
list_indexes(select=...)already existed. Retain prior-version support for the operation and restrict onlysearch,page_size, andsearch_typeto 2026-08.
| @@ -2402,22 +2582,32 @@ def get_index(self, name: str, **kwargs: Any) -> _models1.SearchIndex: | |||
|
|
|||
| @distributed_trace | |||
| @api_version_validation( | |||
| params_added_on={"2026-05-01-preview": ["top", "skip", "count"]}, | |||
| api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], | |||
| method_added_on="2026-08-01-preview", | |||
| @api_version_validation( | ||
| params_added_on={"2026-05-01-preview": ["top", "skip", "count"]}, | ||
| api_versions_list=["2025-11-01-preview", "2026-04-01", "2026-05-01-preview"], | ||
| method_added_on="2026-08-01-preview", |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 72 out of 76 changed files in this pull request and generated no new comments.
Suppressed comments (4)
sdk/search/azure-search-documents/tsp-location.yaml:2
- The declared generation source does not match the PR description: this file targets
84400eeb..., while the description says the SDK was generated fromc19e358.... These are distinct spec commits (the former is the later “Add missing namespace customizations” commit), so the current provenance and blocker narrative cannot both be correct. Please align the PR description with this commit or restore the stated source commit.
sdk/search/azure-search-documents/azure/search/documents/_patch.py:47 - This replaces
V2026_05_01_PREVIEWand changes the effective default, whereas the PR description says to add the new member and keep the default atV2026_05_01_PREVIEW. Besides contradicting the stated scope, existing beta users referencing the old enum member will getAttributeError, and clients that omitapi_versionwill silently switch APIs. Retain the old member/default unless this broader breaking change is intentional and the PR description is updated accordingly.
V2026_08_01_PREVIEW = "2026-08-01-preview"
DEFAULT_VERSION = ApiVersion.V2026_08_01_PREVIEW
sdk/search/azure-search-documents/CHANGELOG.md:16
- This generated feature surface contradicts the PR description, which says the full model/operation regeneration and new
2026-08-01-previewfeatures are blocked and not committed. The diff includes those models, operations, streaming implementation, samples, and tests. Please either update the description to explain that the namespace fix in the targeted spec commit resolved the blocker, or remove the generated surface as described.
- Added multipart File knowledge source operations and models:
- `azure.search.documents.indexes.SearchIndexClient.update_knowledge_source_file`
- `azure.search.documents.indexes.SearchIndexClient.upload_knowledge_source_file_multipart`
- `azure.search.documents.indexes.models.FileUploadMetadata`
- `azure.search.documents.indexes.models.UpdateKnowledgeSourceFileRequest`
- `azure.search.documents.indexes.models.UploadKnowledgeSourceFileMultipartRequest`
sdk/search/azure-search-documents/README.md:51
- The package now declares
requires-python = ">=3.10"and the changelog says Python 3.9 support was dropped, so this prerequisite still incorrectly tells Python 3.9 users that installation is supported.
* Python 3.9 or later is required to use this package.
…into copilot/generate-azure-search-sdk-python-2026-08-01-previe
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 72 out of 76 changed files in this pull request and generated no new comments.
Suppressed comments (5)
sdk/search/azure-search-documents/tsp-location.yaml:2
- The PR description says generation targets spec commit
c19e358860e3cb89a8c7021e8c5a181ab6ef7f62, while this file and the changelog target84400eeb46c48ffe88d81e126449725508c17547. Please make the checked-in generation source and PR description agree so the SDK remains reproducible.
sdk/search/azure-search-documents/azure/search/documents/_patch.py:47 - The PR description explicitly says the effective default remains
V2026_05_01_PREVIEW, but this changes the public default toV2026_08_01_PREVIEW; the generated client configurations and changelog make the same default bump. Either restore the old default across all clients or update the PR scope and rationale to describe this behavioral change.
DEFAULT_VERSION = ApiVersion.V2026_08_01_PREVIEW
sdk/search/azure-search-documents/README.md:51
- This prerequisite still advertises Python 3.9, but
pyproject.tomlnow requires Python 3.10 and the changelog says 3.9 support was dropped. Users on 3.9 would be told they can install a package that packaging metadata rejects.
* Python 3.9 or later is required to use this package.
sdk/search/azure-search-documents/azure/search/documents/knowledgebases/types.py:28
- This relative import targets the nonexistent
azure.search.documents.indexesmodelsmodule. Static type checkers processTYPE_CHECKINGblocks, so the generated cross-namespace annotations cannot be resolved; import these enums fromindexes.models.
sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py:180 - The PR description states that SSE streaming retrieval and the full generated model/operation surface are not included pending the namespace fix, but this adds the public stream implementation and the generated
retrieve_streamoperations/models. Please reconcile the committed scope with the blocker statement before merging.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 72 out of 77 changed files in this pull request and generated no new comments.
Suppressed comments (5)
sdk/search/azure-search-documents/tsp-location.yaml:2
- This commit does not match the spec commit named in the PR description (
c19e358860e3cb89a8c7021e8c5a181ab6ef7f62). Because the generated API surface depends on the exact spec revision, either retarget this file to the described commit or update the PR description and blocker analysis to explain why84400eeb...is now the source of truth.
sdk/search/azure-search-documents/azure/search/documents/_patch.py:47 - The PR description explicitly says the effective default remains
V2026_05_01_PREVIEW, but this changes the package default toV2026_08_01_PREVIEW(and the generated configurations do the same). Resolve the mismatch by either retaining the old default across all clients or updating the PR description and compatibility rationale.
DEFAULT_VERSION = ApiVersion.V2026_08_01_PREVIEW
sdk/search/azure-search-documents/README.md:51
- The documented minimum Python version is inconsistent with
requires-python = ">=3.10"and the changelog entry dropping Python 3.9. Users on Python 3.9 will be told the package is supported even though installation is rejected.
* Python 3.9 or later is required to use this package.
sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_stream.py:181
- The PR description says SSE retrieval and the full generated feature surface are excluded until the namespace defect is fixed, but this adds and publicly exports the streaming implementation along with the generated models and operations. The description/blocker status must be reconciled with the committed surface so reviewers can validate the actual scope and generation provenance.
sdk/search/azure-search-documents/azure/search/documents/indexes/_utils/utils.py:121 - No package test exercises the new multipart construction path, despite its custom handling for model metadata, bare file values, filenames, and content types. Add sync and async request-building tests that verify the emitted multipart metadata and file parts; otherwise regressions here can make both new upload/update operations unusable while samples still import successfully.
def prepare_multipart_form_data(
body: Mapping[str, Any], multipart_fields: list[str], data_fields: list[str]
) -> list[FileType]:
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 87 out of 92 changed files in this pull request and generated no new comments.
Suppressed comments (4)
sdk/search/azure-search-documents/tsp-location.yaml:2
- The PR description says generation targets spec commit
c19e358860e3cb89a8c7021e8c5a181ab6ef7f62, while this file targets the distinct84400eeb46c48ffe88d81e126449725508c17547commit. The latter commit is titled “Add missing namespace customizations,” so it also appears to change the blocker status described in the PR. Please reconcile the stated source commit and blocker before review/release.
sdk/search/azure-search-documents/azure/search/documents/_patch.py:47 - The PR description explicitly says the effective default remains
V2026_05_01_PREVIEW, but this line makes2026-08-01-previewthe package default (and the generated client configurations were changed likewise). This materially changes requests from callers that omitapi_version; either restore the documented unchanged default or update the PR description and rationale.
DEFAULT_VERSION = ApiVersion.V2026_08_01_PREVIEW
sdk/search/azure-search-documents/CHANGELOG.md:11
- The PR description says full model/operation regeneration and samples for the new preview features are not included, but this changelog and the diff add listing, multipart upload, streaming retrieval, Work IQ, and other generated surfaces. Please update the PR scope/blocker narrative or remove the excluded feature surface so reviewers and release notes describe the same change.
- Added filtered and paged resource listing with `search`, `page_size`, and `search_type` parameters.
File listings also support `prefix`.
- Added multipart File knowledge source operations and models:
sdk/search/azure-search-documents/README.md:51
- The prerequisite still claims Python 3.9 support, but this PR changes
requires-pythonto>=3.10and the changelog says 3.9 was dropped. Users on 3.9 would therefore follow incompatible installation guidance.
* Python 3.9 or later is required to use this package.
[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 failedTwo jobs failed in build 6688556 on
Recommended next steps
Raw pipeline analysis (azsdk ci analyze)
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 87 out of 92 changed files in this pull request and generated no new comments.
Suppressed comments (5)
sdk/search/azure-search-documents/azure/search/documents/_patch.py:47
- The PR description explicitly says the effective default remains
V2026_05_01_PREVIEW, but this removes that enum member and makes2026-08-01-previewthe default forSearchClientand the buffered sender (with the generated configurations changed likewise). Either retain the documented default/member or update the PR scope and rationale to reflect this breaking default change.
V2026_08_01_PREVIEW = "2026-08-01-preview"
DEFAULT_VERSION = ApiVersion.V2026_08_01_PREVIEW
sdk/search/azure-search-documents/tsp-location.yaml:2
- The PR description says regeneration targets spec commit
c19e358860e3cb89a8c7021e8c5a181ab6ef7f62and that the generated surface is intentionally not committed, but this pins a different commit (84400eeb...) and the PR includes the full generated models, operations, streaming API, and samples. Align the pinned commit and committed scope with the description so generation provenance is reproducible.
sdk/search/azure-search-documents/azure/search/documents/_utils/utils.py:129 - Required multipart data parts are dropped when their value is falsey. For example, a valid request body with
metadata={}omits themetadatapart entirely, even though both multipart request types require that part. Check forNoneinstead so empty JSON objects and other falsey values are still serialized.
for data_field in data_fields:
data_entry = body.get(data_field)
if data_entry:
files.append((data_field, str(serialize_multipart_data_entry(data_entry))))
sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py:139
- These runtime
__annotations__mutations do not repair the static typing surface shipped in thispy.typedpackage. The regeneratedknowledgebases/types.py:28still imports from nonexistent..indexesmodels, andindexes/types.py:27similarly imports nonexistent..knowledgebasesmodels; the package'signore_missing_importssetting only masks this locally, while consumers cannot resolve those types. Fix the generated/spec namespaces (or the generated TYPE_CHECKING imports) rather than relying only on runtime annotation patching.
sdk/search/azure-search-documents/README.md:51 - The package now declares
requires-python = ">=3.10"and lists only Python 3.10–3.14 inpyproject.toml, so this prerequisite incorrectly tells Python 3.9 users they can install the package.
* Python 3.9 or later is required to use this package.
Regenerate
azure-search-documentsfor Azure Search API2026-08-01-previewfrom spec commitc19e358860e3cb89a8c7021e8c5a181ab6ef7f62.Blocker: generator emits non-importable code (spec defect)
Running the documented generator (
tsp-client update, emitter@azure-tools/typespec-python@0.63.3) against this commit yields a package that fails to import:2026-08-01-previewrequest/response bodies are emitter-synthesized models (EntraAppAuthentication,FileUploadMetadata,KnowledgeBaseRetrieveDefaults,UploadKnowledgeSourceFileMultipartRequest, …) that resolve to the rootSearchTypeSpec namespace.@@clientNamespace("Azure.Search.Documents")inclient.tsp, so the emitter writes them to a top-levelsearch/package (sibling ofazure/) and references them viafrom ......search import models→ImportError: attempted relative import beyond top-level package. Thenamespace=azure.search.documentsemitter option makes it worse (azure.azuredouble-prefix).The fix lives in the spec's
client.tsp(Azure/azure-rest-api-specs), outside the allowed pathsdk/search/azure-search-documents/**. Per "report blockers instead of hand-editing generated code to mask spec issues," the broken generated surface is not committed.Changes (importable subset)
_patch.py— addApiVersion.V2026_08_01_PREVIEW, making the new version selectable on every client via theapi_versionkeyword._configuration.py(a generated file, not hand-edited); bumping only the_patch.pyDEFAULT_VERSIONwould desyncSearchClient/SearchIndexingBufferedSenderfrom the index/indexer/knowledgebase clients, so it's left atV2026_05_01_PREVIEW.tsp-location.yaml/_metadata.json— retarget spec commitc19e358/2026-08-01-preview.Not included (needs spec fix first)
c19e358(blocked by theclient.tsp@@clientNamespacedefect).2026-08-01-previewfeatures (SSE streaming retrieval,autoreasoning tier, multipart upload, WorkIQ auth, listing pagination).