test: add unit tests for Azure OpenAI path in OpenAIEmbeddingFunction#6760
Open
satishkc7 wants to merge 2 commits intochroma-core:mainfrom
Open
test: add unit tests for Azure OpenAI path in OpenAIEmbeddingFunction#6760satishkc7 wants to merge 2 commits intochroma-core:mainfrom
satishkc7 wants to merge 2 commits intochroma-core:mainfrom
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
Contributor
|
Add Azure OpenAI path unit tests for This PR adds a new test module to cover the Azure OpenAI path in This summary was automatically generated by @propel-code-bot |
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.
Closes #1770
The underlying bug (missing
azure_deploymentwhen constructingAzureOpenAI) was fixed in a prior refactor —deployment_idis now accepted and forwarded asazure_deployment. However, there were no tests covering this path at all.This PR adds 10 unit tests in
chromadb/test/ef/test_openai_azure_ef.pythat cover:Validation —
ValueErroris raised with a clear message when any required Azure param is missing:api_versionnot specifieddeployment_idnot specifiedapi_basenot specifiedClient construction —
AzureOpenAIis instantiated with the correct keyword arguments:azure_deploymentreceivesdeployment_idazure_endpointreceivesapi_baseapi_version,api_key, anddefault_headersare forwarded correctlyConfig round-trip —
get_config()persistsdeployment_id, andbuild_from_config()restores the same Azure parameters.All tests mock the
openaipackage so they run without a real API key.