-
Notifications
You must be signed in to change notification settings - Fork 493
[Azure] Fix 'PartitionKey value must be supplied for this operation' error #1537
Conversation
Pull Request Test Coverage Report for Build 53295
💛 - Coveralls |
cleemullins
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will the impact of this change be on folks that have data already stored in CosmosDB and upgrade to this code?
That is, is the behavior of "PartitionKey=Null" the same as the 4.3 code behavior?
@cleemullins This property might be configured only in cases where the user needs to perform a delete operation that requires a |
bd90a0a to
da07323
Compare
|
Build is failing. Here is the Test Error: |
|
@cleemullins, we are currently checking why the Test method is making the build fail. |
|
@cleemullins Build fixed |
cleemullins
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The tests look complete, and the fix seems sensible.
cleemullins
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'm a bit confused. I see _partitionKey has been added which is great.
... however it's only consumed on "delete".
Read/Write don't seem to use this field at all.
Is this correct and by design for CosmosDB, or is this an oversight in the PR?
|
- Add validation for partitionKey parameter
bd7746a to
c338827
Compare
|
Hello @chris, this was an oversight in the PR. The write method doesn't need the partitionKey but the Read method does, so we added new unit tests to validate this and updated the code. |
|
@johnataylor - this looks good to me at this point. I've been staring at it a while though, and would appriciate a 2nd set of eyes. Could you take a look? |
|
@johnataylor - Could you review. This is the same fix (I think) as the JS fix found here: |
|
I'm trying to understand how this would work. A partition key must be a value within the entity. The guide suggests to use |
Description
This PR will fix the Issue #1407.
Changes made
PartitionKeyfield to theCosmosDbStorageOptionsDeleteAsyncmethod to generate theRequestOptionswith thePartitionKeyprovided by theCosmosDbStorageOptionsoptionsoptional parameter to theDeleteDocumentAsyncmethod.Testing
Connect your bot to a CosmosDB
Add the following on the main bot class:
and
On the EmptyBot, it should look something like this.