CartoDB / carto-python

CARTO Python client
https://carto.com
BSD 3-Clause "New" or "Revised" License
154 stars 62 forks source link

BUG: Name map client overwritten #118

Closed jgoizueta closed 5 years ago

jgoizueta commented 5 years ago

When a named map is read (named_map_manager.get(named_map_id)) the API response includes a client field ("client":"cps-1.4.0") and pyrestcli uses it to overwrite the client (e.g. APIKeyAuthClient) of the named map resource.

As a result, any call on the named map object using the client (e.g. an instantiation) will fail (the client is a string!)

jgoizueta commented 5 years ago

Note that this happens only in production, in staging we don't have the client field in the response

jgoizueta commented 5 years ago

On closer inspection, the method from pyrestcli seems OK since it restricts properties copied to those in self.fields and the problem lies in the method overriden in carto-python: https://github.com/CartoDB/carto-python/blob/bcbc66d00feced6e7c9dc713dce7ebfc8d8998d9/carto/maps.py#L165-L166