Skip to content

Instantly share code, notes, and snippets.

@johanste
Created July 30, 2019 02:08
Show Gist options
  • Save johanste/4a91226fd1f98d7d9db59e53d62007d6 to your computer and use it in GitHub Desktop.
Save johanste/4a91226fd1f98d7d9db59e53d62007d6 to your computer and use it in GitHub Desktop.
Changes needed to get to track 2 for cosmos/python.

Track 2 changes

CosmosClient:

Most prominent per-service-request args to change:

  • RetryOptions should take total_retries (was MaxRetryAttemptCount), timeout (was MaxWaitTimeInSeconds), retry_timeout (was FixedRetryIntervalInMilliseconds)
  • additional_headers (was initial_headers).
  • Adhere to the exception hierarchy in azure.core.errors
  • Adhere to paged protocol (add by_page + continuation_token) for returned list-like responses

Less important/urgent:

  • Expand FeedOptions into **kwargs. At a minimum, the feed options parameter should be documented.
  • Rename client class type names to have Client suffix.
  • Provide distributed tracing spans (add decorator on client methods + synchronized_request._Request)
  • Accept a transport object in client constructors (for session sharing etc.)

More controversial, but very obvious name conflicts with other libraries:

  • rename read_all_xxx -> list_xxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment