[search] Flatten async tests and samples into parent directories#45815
Open
[search] Flatten async tests and samples into parent directories#45815
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR flattens the Azure Search Documents package’s async tests and async samples into their parent tests/ and samples/ directories, aligning the package layout with the repo convention and updating internal references that depended on the old subfolders.
Changes:
- Move async test modules into
sdk/search/azure-search-documents/tests/and remove legacyasync_testscollection ignores. - Move async samples into
sdk/search/azure-search-documents/samples/and adjust sample utilities/data path logic accordingly. - Update documentation references (Sphinx
literalincludepaths andsamples/README.mdlinks) to the new sample locations.
Reviewed changes
Copilot reviewed 7 out of 40 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/search/azure-search-documents/tests/test_search_indexer_client_live_async.py | Adds/moves async live indexer client tests into tests/. |
| sdk/search/azure-search-documents/tests/test_search_index_client_synonym_map_live_async.py | Adds/moves async live synonym map tests into tests/. |
| sdk/search/azure-search-documents/tests/test_search_index_client_skillset_live_async.py | Adds/moves async live skillset tests into tests/. |
| sdk/search/azure-search-documents/tests/test_search_index_client_live_async.py | Adds/moves async live index client tests into tests/. |
| sdk/search/azure-search-documents/tests/test_search_index_client_data_source_live_async.py | Adds/moves async live data source tests into tests/. |
| sdk/search/azure-search-documents/tests/test_search_index_client_async.py | Adds async unit-test helper (await_prepared_test) for async tests. |
| sdk/search/azure-search-documents/tests/test_search_index_client_alias_live_async.py | Adds/moves async live alias tests into tests/. |
| sdk/search/azure-search-documents/tests/test_search_client_search_live_async.py | Adds/moves async live search query tests into tests/. |
| sdk/search/azure-search-documents/tests/test_search_client_index_document_live_async.py | Adds/moves async live document indexing tests into tests/. |
| sdk/search/azure-search-documents/tests/test_search_client_buffered_sender_live_async.py | Adds/moves async live buffered sender tests into tests/. |
| sdk/search/azure-search-documents/tests/test_search_client_basic_live_async.py | Adds/moves basic async live tests into tests/. |
| sdk/search/azure-search-documents/tests/test_search_client_async.py | Adds/moves async unit tests into tests/ and updates helper import usage. |
| sdk/search/azure-search-documents/tests/test_knowledge_source_web_live_async.py | Adds/moves async live web knowledge source tests into tests/. |
| sdk/search/azure-search-documents/tests/test_knowledge_source_remote_sharepoint_live_async.py | Adds/moves async live remote SharePoint knowledge source tests into tests/. |
| sdk/search/azure-search-documents/tests/test_knowledge_base_live_async.py | Adds/moves async live knowledge base tests into tests/. |
| sdk/search/azure-search-documents/tests/test_knowledge_base_configuration_live_async.py | Adds/moves async live knowledge base configuration tests into tests/. |
| sdk/search/azure-search-documents/tests/test_buffered_sender_async.py | Adds/moves async buffered sender unit tests into tests/. |
| sdk/search/azure-search-documents/tests/conftest.py | Removes legacy Python<3.5 async test ignore logic. |
| sdk/search/azure-search-documents/samples/sample_search_client_custom_request_async.py | Updates sample utils import path logic after flattening samples. |
| sdk/search/azure-search-documents/samples/sample_query_vector_async.py | Updates data path logic after flattening samples. |
| sdk/search/azure-search-documents/samples/sample_query_suggestions_async.py | Adds/moves async suggestions sample into samples/. |
| sdk/search/azure-search-documents/samples/sample_query_simple_async.py | Adds/moves async simple query sample into samples/. |
| sdk/search/azure-search-documents/samples/sample_query_session_async.py | Adds/moves async session consistency sample into samples/. |
| sdk/search/azure-search-documents/samples/sample_query_semantic_async.py | Adds/moves async semantic query sample into samples/. |
| sdk/search/azure-search-documents/samples/sample_query_filter_async.py | Adds/moves async filter query sample into samples/. |
| sdk/search/azure-search-documents/samples/sample_query_facets_async.py | Adds/moves async facets query sample into samples/. |
| sdk/search/azure-search-documents/samples/sample_query_autocomplete_async.py | Adds/moves async autocomplete sample into samples/. |
| sdk/search/azure-search-documents/samples/sample_indexer_datasource_crud_async.py | Adds/moves async indexer datasource CRUD sample into samples/. |
| sdk/search/azure-search-documents/samples/sample_indexer_crud_async.py | Adds/moves async indexer CRUD sample into samples/. |
| sdk/search/azure-search-documents/samples/sample_index_synonym_map_crud_async.py | Updates data path logic after flattening samples. |
| sdk/search/azure-search-documents/samples/sample_index_crud_async.py | Adds/moves async index CRUD sample into samples/. |
| sdk/search/azure-search-documents/samples/sample_index_client_custom_request_async.py | Updates sample utils import path logic after flattening samples. |
| sdk/search/azure-search-documents/samples/sample_index_analyze_text_async.py | Adds/moves async analyze-text sample into samples/. |
| sdk/search/azure-search-documents/samples/sample_index_alias_crud_async.py | Adds/moves async alias CRUD sample into samples/. |
| sdk/search/azure-search-documents/samples/sample_documents_crud_async.py | Adds/moves async documents CRUD sample into samples/. |
| sdk/search/azure-search-documents/samples/sample_documents_buffered_sender_async.py | Adds/moves async buffered sender sample into samples/. |
| sdk/search/azure-search-documents/samples/sample_authentication_async.py | Adds/moves async auth sample into samples/. |
| sdk/search/azure-search-documents/samples/sample_agentic_retrieval_async.py | Adds/moves async agentic retrieval sample into samples/. |
| sdk/search/azure-search-documents/samples/README.md | Updates async sample links to new flattened locations. |
| sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py | Updates Sphinx literalinclude sample paths for async API docs. |
Comments suppressed due to low confidence (3)
sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py:243
- In
upload_documentsdocstring, the literalinclude pulls the[START get_document_async]snippet fromsample_documents_crud_async.py, but the caption says it's an upload example. This causes the generated docs to show the wrong code sample; update the start/end tags to reference the upload snippet (e.g.,[START upload_document_async]).
.. admonition:: Example:
.. literalinclude:: ../samples/sample_documents_crud_async.py
:start-after: [START get_document_async]
:end-before: [END get_document_async]
:language: python
:dedent: 4
:caption: Upload new documents to an index
sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py:654
- The
autocompletemethod's docstring literalinclude points tosample_query_suggestions_async.pyand uses thesuggest_query_asyncmarkers. This makes the autocomplete docs embed the suggest sample. Update the include path/markers to use the autocomplete sample (sample_query_autocomplete_async.py,autocomplete_query_async).
.. admonition:: Example:
.. literalinclude:: ../samples/sample_query_suggestions_async.py
:start-after: [START suggest_query_async]
:end-before: [END suggest_query_async]
:language: python
:dedent: 4
:caption: Get autocomplete suggestions.
sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py:734
- The
suggestmethod's docstring literalinclude points tosample_query_autocomplete_async.pyand uses theautocomplete_query_asyncmarkers, so the suggest docs embed the autocomplete sample. Swap this to the suggest sample (sample_query_suggestions_async.py,suggest_query_async) to keep the docs accurate.
.. admonition:: Example:
.. literalinclude:: ../samples/sample_query_autocomplete_async.py
:start-after: [START autocomplete_query_async]
:end-before: [END autocomplete_query_async]
:language: python
:dedent: 4
:caption: Get search suggestions.
"""
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
Move async test files from tests/async_tests/ to tests/ and async sample files from samples/async_samples/ to samples/, aligning with the repo-wide convention (225/309 packages use flat layout). Update all internal references: - conftest.py: remove Python 3.5 async_tests ignore - aio/_operations/_patch.py: fix literalinclude paths - samples/README.md: fix async sample links - Fix .parents[1] to .parent in 4 async samples (now same dir as data/) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4f5d531 to
dc9c3c3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move async test files from tests/async_tests/ to tests/ and async sample files from samples/async_samples/ to samples/, aligning with the repo-wide convention.
Update all internal references:
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines