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

[Cosmos] fix endpoint_discovery logic to be user-configurable #21778

Merged
merged 3 commits into from
Nov 22, 2021
Merged
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion sdk/cosmos/azure-cosmos/azure/cosmos/cosmos_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def _build_connection_policy(kwargs):
policy.RequestTimeout
policy.ConnectionMode = kwargs.pop('connection_mode', None) or policy.ConnectionMode
policy.ProxyConfiguration = kwargs.pop('proxy_config', None) or policy.ProxyConfiguration
policy.EnableEndpointDiscovery = kwargs.pop('enable_endpoint_discovery', None) or policy.EnableEndpointDiscovery
policy.EnableEndpointDiscovery = kwargs.pop('enable_endpoint_discovery') \
if 'enable_endpoint_discovery' in kwargs.keys() else policy.EnableEndpointDiscovery
policy.PreferredLocations = kwargs.pop('preferred_locations', None) or policy.PreferredLocations
policy.UseMultipleWriteLocations = kwargs.pop('multiple_write_locations', None) or \
policy.UseMultipleWriteLocations
Expand Down