Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting publications in CARTOframes #1496

Open
Jesus89 opened this issue Jan 17, 2020 · 4 comments
Open

Deleting publications in CARTOframes #1496

Jesus89 opened this issue Jan 17, 2020 · 4 comments

Comments

@Jesus89
Copy link
Member

Jesus89 commented Jan 17, 2020

The way publications are deleted now is incomplete and not very useful. When a map is published, you can use the instance of the map to call delete_publication and it removed the latest publication of the map. However, if you publish the same map instance twice with different names, the first publication is lost and map.delete_publication() removes the second one which is the latest, but not the first.

There is also a static method Map.all_publications to get all the publications, which provides a dict containing the id, url, name, and privacy of the publications. But you can not use this since there is no static method Map.delete_publication(name).

Proposal

My proposal is to remove the instance method delete_publication() and add a Map.delete_publication(name) method. This can be done changing only CF. I have implemented a PoC in this branch: delete-publications.

>>> Map.all_publications(my_creds)
[{...'name': 'map_name',...}...]

>>> Map.delete_publication('map_name', my_creds)
Success! Publication "map_name" deleted

>>> Map.delete_publication('map_name', my_creds)
PublishError: Publication "map_name" not found.

cc @cmongut @oleurud @alasarr

@cmongut
Copy link
Contributor

cmongut commented Jan 19, 2020

delete_publication and all_publications methods don't work as instance methods but neither as static ones of the Map class as it shouldn't have that responsibility. A better option could be to create functions at some level or create a service for publishing.

Said that, with the solution we have already provided, we are giving the user the value we wanted so I would go with this approach.

@Jesus89
Copy link
Member Author

Jesus89 commented Jan 20, 2020

OK, perfect. I agree with adding the methods in viz. We will add this improvement after the 1.0.0 release.

@cmongut cmongut added the triage label Jan 21, 2020
@Jesus89 Jesus89 removed the triage label Jun 17, 2020
@josemazo
Copy link
Contributor

josemazo commented Jul 9, 2020

PR #1497

@Jesus89
Copy link
Member Author

Jesus89 commented Jul 20, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants