Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 30, 2025

  • Add Undefined variant to InnerPartitionKeyValue enum
  • Add public constant UNDEFINED to PartitionKey struct
  • Update serialization in AsHeaders implementation to serialize undefined as {}
  • Add single new test case undefined_value to validate undefined partition key
  • Add assertion to existing tuple test to include undefined value
  • Run clippy to ensure no linting errors
  • Run cargo fmt to format code
  • Update CHANGELOG.md with PR number and link
Original prompt

This section details on the original issue you should resolve

<issue_title>Cosmos: Add a way to represent an undefined Partition Key</issue_title>
<issue_description>We currently support specifying a null value for a partition key in the Cosmos SDK, but have no way to express an undefined partition key. The undefined partition key identifies the partition containing items with no partition key property at all.

In the .NET SDK I believe we call this value None, but we should consider other names, since we already use EMPTY to refer to an empty set of partition keys when making a query (indicating a cross partition query)</issue_description>

<agent_instructions>* Add a marker for Undefined to InnerPartitionKeyValue

  • Add a public constant UNDEFINED to PartitionKey that returns a PartitionKeyValue wrapping this marker
  • Update the serialization code to serialize an undefined value as an empty JSON object: {}
  • Do NOT write any From implementations, this is a niche option that will be specified directly
  • Add a SINGLE new test case for undefined, and add a second assertion to the tuple test case that includes an undefined value.
  • Ensure code compiles and tests pass
  • Run cargo fmt when tests are passing
  • Update CHANGELOG.md with a SINGLE line item for this change in the latest version, matching the format of other entries.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #2586

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] Cosmos: Add a way to represent an undefined Partition Key Add support for undefined partition keys in Cosmos DB Sep 30, 2025
@Copilot Copilot AI requested a review from analogrelay September 30, 2025 16:44
Copilot finished work on behalf of analogrelay September 30, 2025 16:44
### Features Added

* Added `Query::with_text()` and `Query::append_text()` methods to modify query text after creation ([#3044](https://github.com/Azure/azure-sdk-for-rust/pull/3044))
* Added `PartitionKey::UNDEFINED` constant to represent partition keys for items with no partition key property
Copy link
Member

Choose a reason for hiding this comment

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

@copilot update this with the PR number and link now that we have it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the CHANGELOG entry with PR #3075 in commit 4eb4ac2.

Copy link
Contributor Author

Copilot AI commented Sep 30, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/Azure/azure-sdk-for-rust/pulls
    • Triggering command: curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@Copilot Copilot AI requested a review from analogrelay September 30, 2025 16:52
Copilot finished work on behalf of analogrelay September 30, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cosmos: Add a way to represent an undefined Partition Key
2 participants