Skip to content

Commit fc48447

Browse files
authored
Quick patch for debug info (#38639)
* Quick patch for debug info * added get_debug_info * update changelog * update * update
1 parent 2de4a1d commit fc48447

File tree

4 files changed

+33
-10
lines changed

4 files changed

+33
-10
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# Release History
22

3-
## 11.6.0b8 (Unreleased)
3+
## 11.6.0b8 (2024-11-21)
44

55
### Features Added
66

7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
7+
- Added `get_debug_info` in Search results.
128

139
## 11.6.0b7 (2024-11-18)
1410

sdk/search/azure-search-documents/azure/search/documents/_generated/models/_models_py3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# pylint: disable=too-many-lines
22
# coding=utf-8
33
# --------------------------------------------------------------------------
4-
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.26.1)
4+
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.26.5)
55
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
66
# --------------------------------------------------------------------------
77

@@ -1001,7 +1001,7 @@ class SearchDocumentsResult(_serialization.Model):
10011001
"coverage": {"key": "@search\\.coverage", "type": "float"},
10021002
"facets": {"key": "@search\\.facets", "type": "{[FacetResult]}"},
10031003
"answers": {"key": "@search\\.answers", "type": "[QueryAnswerResult]"},
1004-
"debug_info": {"key": "@search\\.debugInfo", "type": "DebugInfo"},
1004+
"debug_info": {"key": "@search\\.debug", "type": "DebugInfo"},
10051005
"next_page_parameters": {"key": "@search\\.nextPageParameters", "type": "SearchRequest"},
10061006
"results": {"key": "value", "type": "[SearchResult]"},
10071007
"next_link": {"key": "@odata\\.nextLink", "type": "str"},

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import json
1111

1212
from azure.core.paging import ItemPaged, PageIterator, ReturnType
13-
from ._generated.models import SearchRequest, SearchDocumentsResult, QueryAnswerResult
13+
from ._generated.models import SearchRequest, SearchDocumentsResult, QueryAnswerResult, DebugInfo
1414
from ._api_versions import DEFAULT_VERSION
1515

1616

@@ -93,6 +93,14 @@ def get_answers(self) -> Optional[List[QueryAnswerResult]]:
9393
"""
9494
return cast(List[QueryAnswerResult], self._first_iterator_instance().get_answers())
9595

96+
def get_debug_info(self) -> DebugInfo:
97+
"""Return the debug information for the query.
98+
99+
:return: the debug information for the query
100+
:rtype: ~azure.search.documents.models.DebugInfo
101+
"""
102+
return cast(DebugInfo, self._first_iterator_instance().get_debug_info())
103+
96104

97105
# The pylint error silenced below seems spurious, as the inner wrapper does, in
98106
# fact, become a method of the class when it is applied.
@@ -160,3 +168,9 @@ def get_answers(self) -> Optional[List[QueryAnswerResult]]:
160168
self.continuation_token = None
161169
response = cast(SearchDocumentsResult, self._response)
162170
return response.answers
171+
172+
@_ensure_response
173+
def get_debug_info(self) -> DebugInfo:
174+
self.continuation_token = None
175+
response = cast(SearchDocumentsResult, self._response)
176+
return cast(DebugInfo, response.debug_info)

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from azure.core.paging import ReturnType
99
from azure.core.async_paging import AsyncItemPaged, AsyncPageIterator
10-
from .._generated.models import QueryAnswerResult, SearchDocumentsResult
10+
from .._generated.models import QueryAnswerResult, SearchDocumentsResult, DebugInfo
1111
from .._paging import (
1212
convert_search_result,
1313
pack_continuation_token,
@@ -77,6 +77,13 @@ async def get_answers(self) -> Optional[List[QueryAnswerResult]]:
7777
"""
7878
return cast(List[QueryAnswerResult], await self._first_iterator_instance().get_answers())
7979

80+
async def get_debug_info(self) -> DebugInfo:
81+
"""Return the debug information for the query.
82+
83+
:return: the debug information for the query.
84+
:rtype: ~azure.search.documents.models.DebugInfo
85+
"""
86+
return cast(DebugInfo, await self._first_iterator_instance().get_debug_info())
8087

8188
# The pylint error silenced below seems spurious, as the inner wrapper does, in
8289
# fact, become a method of the class when it is applied.
@@ -144,3 +151,9 @@ async def get_answers(self) -> Optional[List[QueryAnswerResult]]:
144151
self.continuation_token = None
145152
response = cast(SearchDocumentsResult, self._response)
146153
return response.answers
154+
155+
@_ensure_response
156+
async def get_debug_info(self) -> DebugInfo:
157+
self.continuation_token = None
158+
response = cast(SearchDocumentsResult, self._response)
159+
return cast(DebugInfo, response.debug_info)

0 commit comments

Comments
 (0)