You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When you try to create a new database connection to mongo db you use the class AzureCosmosDBSettings which attempts to parse the env file or the passed arguments.
The issue is that the class defines the connection_string with an alias which prevents parsing it correctly as pydantic doesn't allow using both the alias and the attribute name.
github-actionsbot
changed the title
Bug: Azure MongoDB Connector Assigning Pydantic Fields not by alias
Python: Bug: Azure MongoDB Connector Assigning Pydantic Fields not by alias
Dec 22, 2024
There is another solution which is to use populate_by_name in the pydantic class config but I think that not using the alias as better as it conforms with the other setting classes.
Describe the bug
When you try to create a new database connection to mongo db you use the class
AzureCosmosDBSettings
which attempts to parse the env file or the passed arguments.semantic-kernel/python/semantic_kernel/connectors/memory/azure_cosmosdb/azure_cosmos_db_memory_store.py
Lines 97 to 100 in 926a590
The issue is that the class defines the
connection_string
with an alias which prevents parsing it correctly as pydantic doesn't allow using both the alias and the attribute name.See the issue on stackoverflow:
https://stackoverflow.com/questions/69433904/assigning-pydantic-fields-not-by-alias
To Reproduce
Steps to reproduce the behavior:
Expected behavior
For it to instantiate cosmosdb_settings with connection_string that i passed
Platform
The text was updated successfully, but these errors were encountered: