Closed insatomcat closed 3 years ago
Thanks for the detailed bug report @insatomcat !
Has this been a new thing? Wonder if it changed in a recent release. What is interesting is we should be removing the state
attribute on posts https://github.com/rymurr/dremio_client/blob/master/dremio_client/model/data.py#L553
Is the API call a PUT
maybe?
Either way, we should definitely strip out the state
attribute before returning to Dremio
It's definetely a PUT, since it's a modification of an existing catalog entity https://docs.dremio.com/rest-api/catalog/put-catalog-id/ https://github.com/rymurr/dremio_client/blob/9c6bf83a9260a9114ff046b02ae6507f9754a353/dremio_client/model/data.py#L352
Let me propose fix #221
Description
When trying to modify the ACL of a SOURCE after creating it, I get the following error :
Requested object does not exist on entity : 400 Client Error: Bad Request for url: https://mathis-integration.rte-france.com:443/api/v3/catalog/d251df8f-1515-4c25-b9d6-4318956742d9
the code is as follows:
What I Did
The problem can be worked around in two ways. Either re-init the client between the creation and the modification:
Or (and I found this because I checked the difference between "b" with or without the re-init) by removing the "state" attribute in the SourceMetadata before commiting (note the "b.state = None" line):
Note that this is only needed for sources (and maybe spaces I didn't test) but I don't have to do this to change an ACL on an folder or a VDS.
Maybe it's some dremio specificity that has not been taken into account by dremio_client ?
What do you think ?
Thanks.