Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search fix debug info #40187

Merged
merged 4 commits into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions sdk/search/azure-search-documents/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Release History

## 11.6.0b11 (Unreleased)

### Features Added

### Breaking Changes
## 11.6.0b11 (2025-03-25)

### Bugs Fixed

### Other Changes
- Fixed the issue that could not deserialize `document_debug_info`. #40138

## 11.6.0b10 (2025-03-11)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.28.4)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.30.0)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.28.4)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.30.0)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.28.4)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.30.0)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.28.4)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.30.0)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.28.4)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.30.0)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.28.4)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.30.0)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.28.4)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.30.0)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.28.4)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.30.0)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.28.4)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.30.0)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.28.4)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.30.0)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down Expand Up @@ -1807,7 +1807,7 @@ class SearchResult(_serialization.Model):
:vartype captions: list[~azure.search.documents.models.QueryCaptionResult]
:ivar document_debug_info: Contains debugging information that can be used to further explore
your search results.
:vartype document_debug_info: list[~azure.search.documents.models.DocumentDebugInfo]
:vartype document_debug_info: ~azure.search.documents.models.DocumentDebugInfo
"""

_validation = {
Expand All @@ -1824,7 +1824,7 @@ class SearchResult(_serialization.Model):
"reranker_score": {"key": "@search\\.rerankerScore", "type": "float"},
"highlights": {"key": "@search\\.highlights", "type": "{[str]}"},
"captions": {"key": "@search\\.captions", "type": "[QueryCaptionResult]"},
"document_debug_info": {"key": "@search\\.documentDebugInfo", "type": "[DocumentDebugInfo]"},
"document_debug_info": {"key": "@search\\.documentDebugInfo", "type": "DocumentDebugInfo"},
}

def __init__(self, *, additional_properties: Optional[Dict[str, Any]] = None, **kwargs: Any) -> None:
Expand All @@ -1839,7 +1839,7 @@ def __init__(self, *, additional_properties: Optional[Dict[str, Any]] = None, **
self.reranker_score: Optional[float] = None
self.highlights: Optional[Dict[str, List[str]]] = None
self.captions: Optional[List["_models.QueryCaptionResult"]] = None
self.document_debug_info: Optional[List["_models.DocumentDebugInfo"]] = None
self.document_debug_info: Optional["_models.DocumentDebugInfo"] = None


class VectorThreshold(_serialization.Model):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.28.4)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.30.0)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.28.4)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.30.0)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.28.4)
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.5, generator: @autorest/python@6.30.0)
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,14 +700,14 @@ def _index_documents_actions(self, actions: List[IndexAction], **kwargs: Any) ->
kwargs["headers"] = self._merge_client_headers(kwargs.get("headers"))
batch = IndexBatch(actions=actions)
try:
batch_response = self._client.documents.index(batch=batch, error_map=error_map, **kwargs)
batch_response = self._client.documents.index(batch=batch, **kwargs)
return cast(List[IndexingResult], batch_response.results)
except RequestEntityTooLargeError:
if len(actions) == 1:
raise
pos = round(len(actions) / 2)
batch_response_first_half = self._index_documents_actions(
actions=actions[:pos], error_map=error_map, **kwargs
actions=actions[:pos], **kwargs
)
if batch_response_first_half:
result_first_half = batch_response_first_half
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -704,14 +704,14 @@ async def _index_documents_actions(self, actions: List[IndexAction], **kwargs: A
raise
pos = round(len(actions) / 2)
batch_response_first_half = await self._index_documents_actions(
actions=actions[:pos], error_map=error_map, **kwargs
actions=actions[:pos], **kwargs
)
if batch_response_first_half:
result_first_half = batch_response_first_half
else:
result_first_half = []
batch_response_second_half = await self._index_documents_actions(
actions=actions[pos:], error_map=error_map, **kwargs
actions=actions[pos:], **kwargs
)
if batch_response_second_half:
result_second_half = batch_response_second_half
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ def test_index_documents(self, mock_index):
client.index_documents(batch, extra="foo")
assert mock_index.called
assert mock_index.call_args[0] == ()
assert len(mock_index.call_args[1]) == 4
assert mock_index.call_args[1]["headers"] == client._headers
assert mock_index.call_args[1]["extra"] == "foo"

Expand Down