Open andy-esch opened 6 years ago
Related issue: https://github.com/CartoDB/carto-python/pull/107
Coming from https://github.com/CartoDB/cartoframes/pull/589 as @alrocar said, the implementation would be something like:
carto_dataset = DatasetManager(auth_client).get(table_name)
DROP TABLE
.But If the dataset exists, try to delete it
carto_dataset.delete()
As per this PR it will raise an exception if it has dependent visualizations.
force=true
to the CARTOframes delete method, that will call to carto_dataset.force_delete()
method.Just merged this PR from a @jesusbotella leapfrog 🎉 🎉 🎉
In Python SDK:
dataset.delete()
now raises a CartoException
if the dataset has dependent visualizations.dataset.force_delete()
forces deletion of the dataset (and dependent visualizations).We just could include that logic in the cc.delete(force=True|False)
method
cc.delete does not discriminate whether a dataset is involved in a visualization or not. We should add a trigger that causes
cc.delete
to throw an error if the dataset is claimed. And we should add an additional option toforce=True|False
it to force the operation regardless.Some of this information is available in the private
api/v1/table
endpoint, but I'm unsure if this endpoint should be used outside of builder/editor.