Skip to content

Commit 16a2998

Browse files
hizixinCopilot
andcommitted
Address Copilot review and refine 12.1.0b1 CHANGELOG
- Apply Copilot PR review fixes across _patch.py files: add explicit return type annotations, correct docstrings, and reference api_version via the ApiVersion enum. - Drop a now-redundant pylint useless-suppression in test_search_indexer_models. - Refine the 12.1.0b1 CHANGELOG section: - Promote KeywordTokenizerV2 and PathHierarchyTokenizerV2 (private -> public). - Add "added or changed" group for SearchFieldDataType (string sub-module -> enum class) and SynonymMap.format (class constant -> writable field). - Restructure the serialize()/deserialize() note to the sanctioned "Below methods do not exist on models in this release" lead-in. - Document CommonModelParameters.model -> ChatCompletionCommonModelParameters .model_name and SharePointSensitivityLabelInfo.tooltip -> PurviewSensitivityLabelInfo.tool_tip under properties renamed. - Annotate EntityRecognitionSkill -> V3 (drops include_typeless_entities and skill_version) and SentimentSkill -> V3 (drops skill_version). - Fix the Purview group lead-in to "properties and enum members". Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8cce4d2 commit 16a2998

12 files changed

Lines changed: 345 additions & 78 deletions

File tree

sdk/search/azure-search-documents/CHANGELOG.md

Lines changed: 300 additions & 41 deletions
Large diffs are not rendered by default.

sdk/search/azure-search-documents/azure/search/documents/_operations/_patch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,14 @@ def get_answers(self) -> Optional[List[_models.QueryAnswerResult]]:
352352
"""
353353
return cast(Optional[List[_models.QueryAnswerResult]], self._first_iterator_instance().get_answers())
354354

355-
def get_debug_info(self) -> _models.DebugInfo:
355+
def get_debug_info(self) -> Optional[_models.DebugInfo]:
356356
"""Return the debug information for the query.
357357
358-
:return: the debug information for the query
359-
:rtype: ~azure.search.documents.models.DebugInfo
358+
:return: the debug information for the query, or None when ``debug``
359+
was not requested on the search call.
360+
:rtype: ~azure.search.documents.models.DebugInfo or None
360361
"""
361-
return cast(_models.DebugInfo, self._first_iterator_instance().get_debug_info())
362+
return cast(Optional[_models.DebugInfo], self._first_iterator_instance().get_debug_info())
362363

363364

364365
class _SearchClientOperationsMixin(_SearchClientOperationsMixinGenerated):

sdk/search/azure-search-documents/azure/search/documents/_patch.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ class SearchClient(_SearchClient):
5959
:param index_name: The name of the index. Required.
6060
:type index_name: str
6161
:keyword api_version: The API version to use for this operation. Known values are
62-
"2026-05-01-preview" and None. Default value is "2026-05-01-preview". Note that overriding this
63-
default value may result in unsupported behavior.
64-
:paramtype api_version: str
62+
listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is
63+
``ApiVersion.V2026_05_01_PREVIEW``. Note that overriding this default value may
64+
result in unsupported behavior.
65+
:paramtype api_version: str or ~azure.search.documents.ApiVersion
6566
:keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The
6667
audience is not considered when using a shared key. If audience is not provided, the public cloud
6768
audience will be assumed.

sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,14 @@ async def get_answers(self) -> Optional[List[_models.QueryAnswerResult]]:
169169
"""
170170
return cast(Optional[List[_models.QueryAnswerResult]], await self._first_iterator_instance().get_answers())
171171

172-
async def get_debug_info(self) -> _models.DebugInfo:
172+
async def get_debug_info(self) -> Optional[_models.DebugInfo]:
173173
"""Return the debug information for the query.
174174
175-
:return: the debug information for the query
176-
:rtype: ~azure.search.documents.models.DebugInfo
175+
:return: the debug information for the query, or None when ``debug``
176+
was not requested on the search call.
177+
:rtype: ~azure.search.documents.models.DebugInfo or None
177178
"""
178-
return cast(_models.DebugInfo, await self._first_iterator_instance().get_debug_info())
179+
return cast(Optional[_models.DebugInfo], await self._first_iterator_instance().get_debug_info())
179180

180181

181182
class _SearchClientOperationsMixin(_SearchClientOperationsMixinGenerated):

sdk/search/azure-search-documents/azure/search/documents/aio/_patch.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ class SearchClient(_SearchClient):
3636
:param index_name: The name of the index. Required.
3737
:type index_name: str
3838
:keyword api_version: The API version to use for this operation. Known values are
39-
"2026-05-01-preview" and None. Default value is "2026-05-01-preview". Note that overriding this
40-
default value may result in unsupported behavior.
41-
:paramtype api_version: str
39+
listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is
40+
``ApiVersion.V2026_05_01_PREVIEW``. Note that overriding this default value may
41+
result in unsupported behavior.
42+
:paramtype api_version: str or ~azure.search.documents.ApiVersion
4243
:keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The
4344
audience is not considered when using a shared key. If audience is not provided, the public cloud
4445
audience will be assumed.

sdk/search/azure-search-documents/azure/search/documents/indexes/_operations/_patch.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,8 +869,7 @@ def reset_skills(
869869
870870
:param name: The name of the skillset. Required.
871871
:type name: str
872-
:param skill_names: The names of the skills to reset. If not specified, all skills in the
873-
skillset will be reset. Required.
872+
:param skill_names: The names of the skills to reset. Required.
874873
:type skill_names: ~azure.search.documents.indexes.models.SkillNames or JSON or IO[bytes]
875874
:return: None
876875
:rtype: None

sdk/search/azure-search-documents/azure/search/documents/indexes/_patch.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ class SearchIndexClient(_SearchIndexClient):
2525
:type credential: ~azure.core.credentials.AzureKeyCredential or
2626
~azure.core.credentials.TokenCredential
2727
:keyword api_version: The API version to use for this operation. Known values are
28-
"2026-05-01-preview" and None. Default value is "2026-05-01-preview". Note that overriding this
29-
default value may result in unsupported behavior.
30-
:paramtype api_version: str
28+
listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is
29+
``ApiVersion.V2026_05_01_PREVIEW``. Note that overriding this default value may
30+
result in unsupported behavior.
31+
:paramtype api_version: str or ~azure.search.documents.ApiVersion
3132
:keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The
3233
audience is not considered when using a shared key. If audience is not provided, the public cloud
3334
audience will be assumed.
@@ -50,9 +51,10 @@ class SearchIndexerClient(_SearchIndexerClient):
5051
:type credential: ~azure.core.credentials.AzureKeyCredential or
5152
~azure.core.credentials.TokenCredential
5253
:keyword api_version: The API version to use for this operation. Known values are
53-
"2026-05-01-preview" and None. Default value is "2026-05-01-preview". Note that overriding this
54-
default value may result in unsupported behavior.
55-
:paramtype api_version: str
54+
listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is
55+
``ApiVersion.V2026_05_01_PREVIEW``. Note that overriding this default value may
56+
result in unsupported behavior.
57+
:paramtype api_version: str or ~azure.search.documents.ApiVersion
5658
:keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The
5759
audience is not considered when using a shared key. If audience is not provided, the public cloud
5860
audience will be assumed.

sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_operations/_patch.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,7 @@ async def reset_skills(
848848
849849
:param name: The name of the skillset. Required.
850850
:type name: str
851-
:param skill_names: The names of the skills to reset. If not specified, all skills in the
852-
skillset will be reset. Required.
851+
:param skill_names: The names of the skills to reset. Required.
853852
:type skill_names: ~azure.search.documents.indexes.models.SkillNames or JSON or IO[bytes]
854853
:return: None
855854
:rtype: None

sdk/search/azure-search-documents/azure/search/documents/indexes/aio/_patch.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ class SearchIndexClient(_SearchIndexClient):
2626
:type credential: ~azure.core.credentials.AzureKeyCredential or
2727
~azure.core.credentials_async.AsyncTokenCredential
2828
:keyword api_version: The API version to use for this operation. Known values are
29-
"2026-05-01-preview" and None. Default value is "2026-05-01-preview". Note that overriding this
30-
default value may result in unsupported behavior.
31-
:paramtype api_version: str
29+
listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is
30+
``ApiVersion.V2026_05_01_PREVIEW``. Note that overriding this default value may
31+
result in unsupported behavior.
32+
:paramtype api_version: str or ~azure.search.documents.ApiVersion
3233
:keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The
3334
audience is not considered when using a shared key. If audience is not provided, the public cloud
3435
audience will be assumed.
@@ -53,9 +54,10 @@ class SearchIndexerClient(_SearchIndexerClient):
5354
:type credential: ~azure.core.credentials.AzureKeyCredential or
5455
~azure.core.credentials_async.AsyncTokenCredential
5556
:keyword api_version: The API version to use for this operation. Known values are
56-
"2026-05-01-preview" and None. Default value is "2026-05-01-preview". Note that overriding this
57-
default value may result in unsupported behavior.
58-
:paramtype api_version: str
57+
listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is
58+
``ApiVersion.V2026_05_01_PREVIEW``. Note that overriding this default value may
59+
result in unsupported behavior.
60+
:paramtype api_version: str or ~azure.search.documents.ApiVersion
5961
:keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The
6062
audience is not considered when using a shared key. If audience is not provided, the public cloud
6163
audience will be assumed.

sdk/search/azure-search-documents/azure/search/documents/knowledgebases/_patch.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ class KnowledgeBaseRetrievalClient(_KnowledgeBaseRetrievalClient):
2626
:param knowledge_base_name: The name of the knowledge base. Required.
2727
:type knowledge_base_name: str
2828
:keyword api_version: The API version to use for this operation. Known values are
29-
"2026-05-01-preview" and None. Default value is "2026-05-01-preview". Note that overriding this
30-
default value may result in unsupported behavior.
31-
:paramtype api_version: str
29+
listed on the :class:`~azure.search.documents.ApiVersion` enum. Default value is
30+
``ApiVersion.V2026_05_01_PREVIEW``. Note that overriding this default value may
31+
result in unsupported behavior.
32+
:paramtype api_version: str or ~azure.search.documents.ApiVersion
3233
:keyword str audience: Sets the Audience to use for authentication with Microsoft Entra ID. The
3334
audience is not considered when using a shared key. If audience is not provided, the public cloud
3435
audience will be assumed.

0 commit comments

Comments
 (0)