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
The "create_or_update" and "update" functions actually behave more like "create_or_overwrite". This is caused by the methods passing all of the API's parameters, including those it created default values for, the result is that all of the fields get updated regardless if the user specified them or not.
I don't think the library should be adding keys to the params dicts unless the user explicitly provided a value for it. For example, this snippet from update_entity could be replaced with:
if metadata is not None and not isinstance(metadata, dict):
error_msg = 'unsupported metadata argument provided "{arg}" ({arg_type}), required type: dict"'
raise exceptions.ParamValidationError(error_msg.format(
arg=metadata,
arg_type=type(metadata),
))
params = {}
if name is not None:
params["name"] = name
if metadata is not None:
params["metadata"] = metadata
if policies is not None:
params["policies"] = policies
if disabled is not None:
params["disabled"] = disabled
The text was updated successfully, but these errors were encountered:
I just got bitten by this pretty badly.
The "create_or_update" and "update" functions actually behave more like "create_or_overwrite". This is caused by the methods passing all of the API's parameters, including those it created default values for, the result is that all of the fields get updated regardless if the user specified them or not.
I've created a gist to demonstrate the issue: https://gist.github.com/llamasoft/ab5724feddf1580cde1ac16f5065a98e
I don't think the library should be adding keys to the
params
dicts unless the user explicitly provided a value for it. For example, this snippet fromupdate_entity
could be replaced with:The text was updated successfully, but these errors were encountered: