-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CosmosDB] Query fails when setting partition_key #13519
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @wmengmsft, @MehaKaushik, @shurd, @anfeldma-ms |
@Rodrigossz Can you look into this? May be an issue with the samples for how to do query |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @zfoster, @southpolesteve. |
Hello @chrisyeh96 Tks for the feedback. We will check it out. As a workaround you can use 'select children from Families'. BTW, you sample code has 'testcontainer' instead of Families, but I think that it's a copy/paste error. Tks for the contribution! |
Hello @chrisyeh96 I'm closing this issue because it's a documentation problem, what I will start to address today. Basically what is happening is that your are narrowing down the scope with the FROM clause: instead of Families, and all of it's properties, your "dataset" only has the children property. And the partition key isn't there. Tks for the help to improve the product. |
@Rodrigossz Thanks for looking into this issue. However, I'm not convinced that narrowing down the scope in the Plus, the queries work just fine in Data Explorer on the Azure web portal. This is clearly an issue with the Python SDK, not with my query. |
Data Explorer uses another SDK behind the interface and has different environment settings. As an example, it runs all queries as cross partition enabled. So you can expect absolutely different behavior between any SDK and Data Explorer. When you use If you try the same in the Data Explorer you will get:
Please note that for
The SDK will transform into SELECT * FROM Families.children where Families.children.id = 'AndersenFamily' , what doesn't work. I am adding clarifications on that to the Python SDK README file. |
Network february release (Azure#14333) * Adds base for updating Microsoft.Network from version stable/2020-11-01 to version 2021-02-01 * Updates readme * Updates API version in new specs and examples * init (Azure#13496) Co-authored-by: matyang222 <[email protected]> * Swagger change for CustomIpPrefix. Adding four new attributes. (Azure#13456) * update swagger * fix apiversion * fix * add Co-authored-by: Weiheng Li <[email protected]> * typo: paramter in applicationGateway.json (Azure#13538) * VPN NAT for Virtual Network Gateway feature changes(networkFeb) (Azure#13481) * commit1 * commit2 * resolving comments * pythonMd Co-authored-by: Khushboo Baheti <[email protected]> * fix virtual network resource (Azure#13570) * Added a new feature FlowTimeoutInMinutes under Virtual Network Proper… (Azure#13519) * Added a new feature FlowTimeoutInMinutes under Virtual Network Properties * Updated the type from string to integer, added a non-null example * Added missing format for 'integer' type * Add new failedMessage property for CustomIpPrefix (Azure#13607) * update swagger * fix apiversion * fix * add * add failedreason property * update swagger * fix apiversion * fix * add failedreason property * update Co-authored-by: Weiheng Li <[email protected]> * Added Preferred Routing Gateway Support (Azure#13611) * Feature: Address space update in peered vNets (Azure#13521) * Adding new fields and operation to support the address space update in peered vNets Adding new fields and operation to support the address space update in peered vNets * Adding the new query param in the example As per the review comment, adding the new query param in the example request response of swagger. * Adding the new query param in examples Adding the new query param in examples * Restricting the sync param Restricting the sync param to hold only true as value. We never need to send false. Co-authored-by: Hari Prasad Perabattula <[email protected]> * Remove max file size limit enforcement as it is done in NRP (Azure#13679) * Tesha/fix waf policy examples crs version (Azure#13697) * Remove max file size limit enforcement as it is done in NRP * Update the CRS version in the examples to reflect latest * Fix (Azure#13734) Co-authored-by: Khushboo Baheti <[email protected]> * Swagger for NRP's VipSwap operation (Azure#13639) * Swagger for NRP's VipSwap operation * Fixing validation errors * minor fix * Adding api version * Remove required (Azure#13969) Co-authored-by: Will Ehrich <[email protected]> * Hotfix extended location parameter hierarchy (Azure#13864) * add to feb branch * delete project name reference * expose two new client cert properties: validatedCertData, clientCertIssuerDN (Azure#13989) * adding workloadType property for Baremetal scenarios (Azure#14101) * Added bastion sku (Azure#14248) * fix nrp resources based on s360 checks (Azure#14219) * Adding Azure Network Manager association to the EffectiveNetworkSecurityGroups API (Azure#14265) * Added Azure Network Manager association to the EffectiveNetworkSecurityGroupAssociation * Adding example for networkManager response in the EffectiveNSG call * Add deleteOption to PublicIPAddress (Azure#14343) * Add deleteOption to PublicIPAddress * run validators Co-authored-by: Bashar Gharaibeh <[email protected]> Co-authored-by: Matthew Yang <[email protected]> Co-authored-by: matyang222 <[email protected]> Co-authored-by: Tom Li <[email protected]> Co-authored-by: Weiheng Li <[email protected]> Co-authored-by: Nick Schonning <[email protected]> Co-authored-by: Khushboo Baheti <[email protected]> Co-authored-by: Khushboo Baheti <[email protected]> Co-authored-by: guptas14 <[email protected]> Co-authored-by: Satya-anshu <[email protected]> Co-authored-by: arvenka <[email protected]> Co-authored-by: Hari Prasad Perabattula <[email protected]> Co-authored-by: Hari Prasad Perabattula <[email protected]> Co-authored-by: tejasshah7 <[email protected]> Co-authored-by: shnaya434 <[email protected]> Co-authored-by: William Ehrich <[email protected]> Co-authored-by: Will Ehrich <[email protected]> Co-authored-by: litchiyangMSFT <[email protected]> Co-authored-by: biaogao <[email protected]> Co-authored-by: bhbhise <[email protected]> Co-authored-by: mscorp-buchen <[email protected]> Co-authored-by: Arpit Agarwal <[email protected]> Co-authored-by: basharg <[email protected]> Co-authored-by: Bashar Gharaibeh <[email protected]>
Describe the bug
I created a test CosmosDB database using the Azure web portal with the examples from the CosmosDB Getting Started documentation.
I set the
partition_key
on the container to be the"id"
field. I can run the following queries (from the SQL Query Object Array page) via the "Data Explorer" on the Azure web portal just fine, but the Python SDK has issues when I setpartition_key
on the query.The following two queries work fine in Data Explorer on the Azure web portal:
Both queries throw errors in the Python SDK when I pass a
partition_key
parameter toquery_items()
:Expected behavior
Setting
partition_key
onquery_items()
should not cause an error.Additional context
I suspect that this may be related to the bug reported in #11721. However, my example here is much simpler and identifies the issue with passing a
partition_key
argument toquery_items()
.The text was updated successfully, but these errors were encountered: