Skip to content

Fix SQL container throughput update to preserve existing throughput buckets#9033

Merged
evelyn-ys merged 6 commits intoAzure:mainfrom
Achint-Agrawal:TBWithThroughputChange
Aug 1, 2025
Merged

Fix SQL container throughput update to preserve existing throughput buckets#9033
evelyn-ys merged 6 commits intoAzure:mainfrom
Achint-Agrawal:TBWithThroughputChange

Conversation

@Achint-Agrawal
Copy link
Copy Markdown
Contributor

Fixes a bug where updating SQL container throughput would reset existing throughput buckets to None when the --throughput-buckets parameter was not explicitly provided. The fix preserves existing throughput buckets when the parameter is omitted, only removing them when explicitly set to an empty array.
This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az cosmosdb sql container throughput update

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI review requested due to automatic review settings August 1, 2025 04:26
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Aug 1, 2025

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @Achint-Agrawal,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Aug 1, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 1, 2025

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug in the CosmosDB SQL container throughput update functionality where existing throughput buckets were being unintentionally reset to None when the --throughput-buckets parameter was not explicitly provided. The fix preserves existing throughput buckets when the parameter is omitted and only removes them when explicitly set to an empty array.

Key changes:

  • Added logic to preserve existing throughput buckets when the parameter is not provided
  • Enhanced test coverage to verify both bucket preservation and explicit bucket removal scenarios

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
custom.py Added logic to retrieve and preserve existing throughput buckets when throughput_buckets parameter is None
test_cosmosdb_sql_throughput_bucketing_scenario.py Added comprehensive test cases to verify bucket preservation and explicit removal behavior

Comment thread src/cosmosdb-preview/azext_cosmosdb_preview/custom.py Outdated
Comment thread src/cosmosdb-preview/azext_cosmosdb_preview/custom.py Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Aug 1, 2025

@evelyn-ys evelyn-ys merged commit be8ce75 into Azure:main Aug 1, 2025
24 checks passed
@azclibot
Copy link
Copy Markdown
Collaborator

azclibot commented Aug 1, 2025

[Release] Update index.json for extension [ cosmosdb-preview-1.6.1 ] : https://dev.azure.com/msazure/One/_build/results?buildId=132367107&view=results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot CosmosDB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants