You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "~/example.py", line 71, in <module>
device.save(conditions=dict(device_id__ne='BAD_DEVICE_ID'))
File "~/venv/lib/site-packages/dynamorm/model.py", line 470, in save
resp = self.Table.put(as_dict, **kwargs)
File "~/venv/lib/site-packages/dynamorm/table.py", line 566, in put
return self.table.put_item(Item=remove_nones(item), **kwargs)
File "~/venv/lib/site-packages/boto3/resources/factory.py", line 520, in do_action
response = action(self, *args, **kwargs)
File "~/venv/lib/site-packages/boto3/resources/action.py", line 83, in __call__
response = getattr(parent.meta.client, operation_name)(**params)
File "~/venv/lib/site-packages/botocore/client.py", line 357, in _api_call
return self._make_api_call(operation_name, kwargs)
File "~/venv/lib/site-packages/botocore/client.py", line 634, in _make_api_call
api_params, operation_model, context=request_context)
File "~/venv/lib/site-packages/botocore/client.py", line 682, in _convert_to_request_dict
api_params, operation_model)
File "~/venv/lib/site-packages/botocore/validate.py", line 297, in serialize_to_request
raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Unknown parameter in input: "conditions", must be one of: TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues
After playing with this library some more, I realize the appropriate method to use would be put, however, put doesn't support the conditions kwarg. We have to manually construct a ConditionExpression which gets passed to boto3.
borgstrom
changed the title
Using conditions= on save results in an error
Support conditions= for save and put operations
Feb 6, 2020
Class looks like:
When I do:
I get this traceback.
It does however, work with
update
:The text was updated successfully, but these errors were encountered: