-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix Environment Variable Parsing #40303
Conversation
/azp run python - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes environment variable parsing issues by refactoring how environment variable values are accessed and converted, leveraging a new constants file for configuration. Key changes include:
- Updating test files to set and validate environment variables for vector and hybrid search queries.
- Refactoring client connection and execution context files to use constant definitions for environment variable keys and defaults.
- Adding new constants in _constants.py for improved configuration management.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
sdk/cosmos/azure-cosmos/tests/test_query_vector_similarity_async.py | Added tests for vector search with environment variable overrides. |
sdk/cosmos/azure-cosmos/tests/test_query_vector_similarity.py | Added similar vector search tests for synchronous queries. |
sdk/cosmos/azure-cosmos/tests/test_query_hybrid_search_async.py | Introduced hybrid search tests with environment variable configurations. |
sdk/cosmos/azure-cosmos/tests/test_query_hybrid_search.py | Added synchronous hybrid search tests using environment variable settings. |
sdk/cosmos/azure-cosmos/azure/cosmos/aio/_cosmos_client_connection_async.py | Updated environment variable usage to retrieve non-streaming order by flag using constants. |
sdk/cosmos/azure-cosmos/azure/cosmos/_execution_context/execution_dispatcher.py | Refactored hybrid and vector search environment variable parsing via constants with int conversion. |
sdk/cosmos/azure-cosmos/azure/cosmos/_execution_context/aio/execution_dispatcher.py | Updated vector search environment variable handling to use constants and int conversion. |
sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py | Refactored non-streaming order by environment variable check to use constants. |
sdk/cosmos/azure-cosmos/azure/cosmos/_constants.py | Added new constants for environment variable keys and their defaults. |
sdk/cosmos/azure-cosmos/CHANGELOG.md | Updated changelog to document the environment variable parsing fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this @tvaron3
API change check API changes are not detected in this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/azp run python - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run python - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
Description
Environment variables were not being parsed correctly and would cause type errors or unexpected behavior. Refactored the environment variables to be part of the constants file to be easily accessible.