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

API Key Not Being Passed On Paged Requests #23477

Merged
merged 4 commits into from
Mar 14, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions sdk/search/azure-search-documents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Breaking Changes

### Bugs Fixed
- Bug fix for async paged requests to use api keys
kashifkhan marked this conversation as resolved.
Show resolved Hide resolved

### Other Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async def _get_next_cb(self, continuation_token):
_next_link, next_page_request = unpack_continuation_token(continuation_token)

return await self._client.documents.search_post(
search_request=next_page_request
search_request=next_page_request, **self._kwargs
)

async def _extract_data_cb(self, response): # pylint:disable=no-self-use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,18 @@ async def _test_suggest(self, client):
{"hotelId": "2", "text": "Cheapest hotel in town. Infact, a motel."},
{"hotelId": "9", "text": "Secret Point Motel"},
]

@SearchEnvVarPreparer()
@search_decorator(schema="hotel_schema.json", index_batch="hotel_large.json")
@recorded_by_proxy_async
async def test_search_client(self, endpoint, api_key, index_name):
client = SearchClient(endpoint, index_name, api_key)
async with client:
await self._test_get_search_simple_large(client)

async def _test_get_search_simple_large(self, client):
results = []
async for x in await client.search(search_text = ''):
results.append(x)
assert len(results) == 60

Loading