-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Subpartitioning Python Cosmos DB SDK (#31121)
* sub partitioning adding subpartitioning * Additional Sub Partitioning Updates Fixes some edge cases. This also adds tests for subpartitioning CRUD operations that match Java SDK as well as some python specific edge cases. This also adds samples for subpartitioning in python. * remove uneeded line remove line of code that was used for testing * update changelog update changelog to include new feature * pylint fixes fixes for pylint issues * remove debug code on subpartition test removes left over debugging code on subpartition test * Adding support for prefix partition queries Adding support for using incomplete partition key values (prefix partition key) for subpartition queries. * pylint and cspell fixes Adds additional fixes related to pylint and cspell * Additional Updates and fixes Includes fixes: making methods and properties in partitionkey class private, fix for partitionkeydelete for subpartitioning, and fixes that broke some tests. * removing uneeded lines from test config * Test fix Partitionkey headers expects no spaces in subpartition pks * update test crud subpartition * Update test_config.py * additional feedback fixes * Fixed Python Version Compatibility Fixed issue with importing Literal to make it compatible with all python versions * Fixed small issue causing tests to fail Fixed issue where self.last_headers wasn't being properly cleared up between tests. * Testing fix for subpartitioning Test was using wrong index to get the right pk value from last_headers. This bug only appears when all tests are run together. * Update test_crud_subpartition_async.py * Update test_crud_subpartition_async.py * Update dev_requirements.txt * Update async test and samples Updated async test to work with pytest async testing. Updated async samples to match non async samples. * Change public method to be private changing get epk range for prefix partition key to be private * Added support for prefix query involving multiple over lapping ranges In the case of large databases, a prefix query involving a container with subpartitioning may involve multiple physical partitions. This allows for a prefix query to properly query items from all the partitions that contain the prefix partition keys. * Better over lapping support and new over lapping range tests This commit adds better support for the case of a prefix query needing to query multiple physical partitions. It will query each partition with the needed partition key range for each physical partition. New tests were also added to test this functionality. * Clarified information in some comments Added a comment explaining the fourth case of what EPK sub range could equal. In that case the epk sub range equals the feed range EPK as it is within the range of a physical partition without spanning the entire physical partition. --------- Co-authored-by: simorenoh <simonmorenohe@gmail.com>
- Loading branch information
Showing
19 changed files
with
2,371 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.