Skip to content

Conversation

tvaron3
Copy link
Member

@tvaron3 tvaron3 commented Aug 28, 2025

Description

Fixes bug where partition key is none would break query items because of a duplicate argument error.

@Copilot Copilot AI review requested due to automatic review settings August 28, 2025 03:23
@tvaron3 tvaron3 requested a review from a team as a code owner August 28, 2025 03:23
Copy link
Contributor

@Copilot 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 where calling query_items with partition_key=None would cause a duplicate argument error. The fix modifies the parameter handling logic to use pop() with a default value instead of checking for existence before popping, which eliminates the duplicate argument issue.

  • Refactors partition key parameter handling in both sync and async container query methods
  • Adds comprehensive test coverage for the None partition key scenario

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
sdk/cosmos/azure-cosmos/azure/cosmos/container.py Updates sync container query_items method to handle None partition key properly
sdk/cosmos/azure-cosmos/azure/cosmos/aio/_container.py Updates async container query_items method to handle None partition key properly
sdk/cosmos/azure-cosmos/tests/test_query.py Adds test case for sync query with None partition key
sdk/cosmos/azure-cosmos/tests/test_query_async.py Adds test case for async query with None partition key

@tvaron3
Copy link
Member Author

tvaron3 commented Aug 28, 2025

/azp run python - cosmos - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants