Skip to content

Commit 4a6cd64

Browse files
committed
Azure Cosmos update fix
1 parent 2cfdc0d commit 4a6cd64

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Changelog
22
=========
33

4+
## [v0.0.25] - 2024-05-21
5+
- Azure Cosmos update fix
6+
47
## [v0.0.24] - 2024-05-15
58
- Google KMS support and audit_callback
69

abnosql/plugins/table/cosmos.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,16 @@ def put_item(
231231

232232
# do update
233233
if update is True:
234+
update_item = {
235+
k: v for k, v in item.items()
236+
if k not in self.key_attrs
237+
}
234238
kwargs = {
235239
'item': key[self.key_attrs[-1]],
236240
'partition_key': key[self.key_attrs[0]],
237241
'patch_operations': [
238242
{'op': 'add', 'path': f'/{k}', 'value': v}
239-
for k, v in item.items()
243+
for k, v in update_item.items()
240244
]
241245
}
242246
item = self._container(self.name).patch_item(**kwargs)

abnosql/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '0.0.24'
1+
__version__ = '0.0.25'
22

33

44
if __name__ == '__main__':

0 commit comments

Comments
 (0)