File tree 4 files changed +13
-1
lines changed
4 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
Changelog
2
2
=========
3
3
4
+ ## [ v0.0.19] - 2023-10-09
5
+ - skip validation on cosmos delete
6
+
4
7
## [ v0.0.18] - 2023-10-09
5
8
- audit_user as config option
6
9
Original file line number Diff line number Diff line change @@ -377,6 +377,12 @@ def validate_item(
377
377
schema = config .get (f'{ operation } _schema' , config .get ('schema' ))
378
378
if schema is None :
379
379
return
380
+ camel_case = os .environ .get ('ABNOSQL_CAMELCASE' , 'TRUE' ) == 'TRUE'
381
+ meta_attr = 'changeMetadata' if camel_case else 'change_metadata'
382
+ name_attr = 'eventName' if camel_case else 'event_name'
383
+ existing_event = item .get (meta_attr , {}).get (name_attr )
384
+ if existing_event == 'REMOVE' :
385
+ return
380
386
title = config .get (
381
387
f'{ operation } _schema_errmsg' ,
382
388
config .get ('schema_errmsg' , 'invalid item' )
Original file line number Diff line number Diff line change 1
- __version__ = '0.0.18 '
1
+ __version__ = '0.0.19 '
2
2
3
3
4
4
if __name__ == '__main__' :
Original file line number Diff line number Diff line change @@ -188,6 +188,9 @@ def test_validate_item():
188
188
'type' : None
189
189
}
190
190
191
+ # check can delete with no validation (cosmos)
192
+ tb .delete_item (hk = '1' , rk = 'a' )
193
+
191
194
192
195
def test_put_item (config = None ):
193
196
tb = table ('hash_range' , config )
You can’t perform that action at this time.
0 commit comments