Skip to content

feat(cosmos): Expand impl Into<PartitionKey> Examples and Tests#4220

Open
raushan728 wants to merge 2 commits intoAzure:release/azure_data_cosmos-previewsfrom
raushan728:partition-key-examples-issue-3570
Open

feat(cosmos): Expand impl Into<PartitionKey> Examples and Tests#4220
raushan728 wants to merge 2 commits intoAzure:release/azure_data_cosmos-previewsfrom
raushan728:partition-key-examples-issue-3570

Conversation

@raushan728
Copy link
Copy Markdown
Contributor

Closes #3570

  • Added missing From<bool> implementation
  • Added doc comment examples to all From impls
  • Added unit tests for all supported partition key types
  • Added #[should_panic] tests for NaN and Infinity edge cases

Copilot AI review requested due to automatic review settings April 19, 2026 11:36
@raushan728 raushan728 requested a review from a team as a code owner April 19, 2026 11:36
@github-actions github-actions Bot added Community Contribution Community members are working on the issue Cosmos The azure_cosmos crate customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Apr 19, 2026
@github-actions
Copy link
Copy Markdown

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

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 enhances Cosmos partition key usability and discoverability by expanding documentation examples around the impl Into<PartitionKey> pattern and adding unit tests that exercise additional supported partition key input types and edge cases.

Changes:

  • Added doc examples to the various From conversions used by PartitionKey/PartitionKeyValue.
  • Added missing From<bool> implementation for PartitionKeyValue.
  • Expanded unit tests to cover booleans, additional string forms, hierarchical tuples, Option<T> behavior, and NaN/Infinity panics.

Comment thread sdk/cosmos/azure_data_cosmos/src/partition_key.rs Outdated
@raushan728 raushan728 force-pushed the partition-key-examples-issue-3570 branch from cfca5f3 to 5b42f95 Compare April 19, 2026 12:05
@raushan728
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 4220 in repo Azure/azure-sdk-for-rust

@raushan728 raushan728 force-pushed the partition-key-examples-issue-3570 branch from 5b42f95 to 3eef7f8 Compare April 27, 2026 13:02
@analogrelay
Copy link
Copy Markdown
Member

Hi @raushan728 ! Thanks for the contribution. We're actually working out of a release branch right now. Would you mind rebasing your changes on release/azure_data_cosmos-previews and updating the PR? That will help us be able to review and merge this more quickly :)

@raushan728 raushan728 force-pushed the partition-key-examples-issue-3570 branch from 3eef7f8 to 0503cff Compare April 29, 2026 04:21
@raushan728 raushan728 changed the base branch from main to release/azure_data_cosmos-previews April 29, 2026 04:22
@raushan728
Copy link
Copy Markdown
Contributor Author

@analogrelay Done! Rebased on release/azure_data_cosmos-previews and updated the PR base branch.

Copy link
Copy Markdown
Member

@analogrelay analogrelay left a comment

Choose a reason for hiding this comment

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

Looks good. FYI, this type will be merging with the one in azure_data_cosmos_driver in the near future, but we can ensure that includes these changes as well :).

@analogrelay analogrelay enabled auto-merge (squash) April 30, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community Contribution Community members are working on the issue Cosmos The azure_cosmos crate customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Cosmos: Expand impl Into<PartitionKey> Examples and Doc Comments

3 participants