Version 4.0.0b2:
Version 4.0.0b2 is the second iteration in our efforts to build a more Pythonic client library.
Breaking changes
- The client connection has been adapted to consume the HTTP pipeline defined in
azure.core.pipeline
. - Interactive objects have now been renamed as proxies. This includes:
Database
->DatabaseProxy
User
->UserProxy
Container
->ContainerProxy
Scripts
->ScriptsProxy
- The constructor of
CosmosClient
has been updated:- The
auth
parameter has been renamed tocredential
and will now take an authentication type directly. This means the master key value, a dictionary of resource tokens, or a list of permissions can be passed in. However the old dictionary format is still supported. - The
connection_policy
parameter has been made a keyword only parameter, and while it is still supported, each of the individual attributes of the policy can now be passed in as explicit keyword arguments:request_timeout
media_request_timeout
connection_mode
media_read_mode
proxy_config
enable_endpoint_discovery
preferred_locations
multiple_write_locations
- The
- A new classmethod constructor has been added to
CosmosClient
to enable creation via a connection string retrieved from the Azure portal. - Some
read_all
operations have been renamed tolist
operations:CosmosClient.read_all_databases
->CosmosClient.list_databases
Container.read_all_conflicts
->ContainerProxy.list_conflicts
Database.read_all_containers
->DatabaseProxy.list_containers
Database.read_all_users
->DatabaseProxy.list_users
User.read_all_permissions
->UserProxy.list_permissions
- All operations that take
request_options
orfeed_options
parameters, these have been moved to keyword only parameters. In addition, while these options dictionaries are still supported, each of the individual options within the dictionary are now supported as explicit keyword arguments. - The error heirarchy is now inherited from
azure.core.AzureError
instead ofCosmosError
which has been removed.HTTPFailure
has been renamed toCosmosHttpResponseError
JSONParseFailure
has been removed and replaced byazure.core.DecodeError
- Added additional errors for specific response codes:
CosmosResourceNotFoundError
for status 404CosmosResourceExistsError
for status 409CosmosAccessConditionFailedError
for status 412
CosmosClient
can now be run in a context manager to handle closing the client connection.- Iterable responses (e.g. query responses and list responses) are now of type
azure.core.paging.ItemPaged
. The methodfetch_next_block
has been replaced by a secondary iterator, accessed by theby_page
method.