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

Prevent deleting databases that have attached tables #5749

Merged
merged 2 commits into from Aug 28, 2018

Conversation

mistercrunch
Copy link
Member

screen shot 2018-08-27 at 5 41 32 pm

Similar to logic preventing deleting tables that have charts attached.

Similar to logic preventing deleting tables that have charts attached.
raise SupersetException(Markup(
'Cannot delete a database that has tables attached. '
"Here's the list of associated tables: " +
''.join(['{}'.format(o) for o in obj.tables])))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to join them with a comma here, no? Also, you don't need format nor the list comprehension:

', '.join(str(o) for o in obj.tables)))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow I missed the coma... About str I've been steering away from it since in py2 it won't do unicode properly. .format() always work and does unicode if using the future unicode literals imports.

I'm surprised to see the comprehension working without the brackets, I'm guessing then it's a generator.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, true... I keep forgetting about Python 2.

And yeah, removing the brackets create a generator which is immediately consumed by the join method.

@codecov-io
Copy link

Codecov Report

Merging #5749 into master will decrease coverage by <.01%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5749      +/-   ##
==========================================
- Coverage   63.43%   63.43%   -0.01%     
==========================================
  Files         362      362              
  Lines       22983    22986       +3     
  Branches     2557     2557              
==========================================
+ Hits        14580    14581       +1     
- Misses       8388     8390       +2     
  Partials       15       15
Impacted Files Coverage Δ
superset/views/core.py 73.84% <33.33%> (-0.1%) ⬇️
...uperset/assets/src/datasource/DatasourceEditor.jsx 72.92% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 46a048b...03793e9. Read the comment docs.

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@betodealmeida betodealmeida merged commit 6cc52c6 into apache:master Aug 28, 2018
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Sep 21, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 11, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 11, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 11, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 12, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 12, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 12, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Oct 17, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Oct 17, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Oct 17, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Oct 17, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Oct 17, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
mistercrunch added a commit to lyft/incubator-superset that referenced this pull request Oct 29, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 30, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 30, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 30, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 30, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 30, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Nov 2, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
youngyjd pushed a commit to lyft/incubator-superset that referenced this pull request Nov 2, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments

(cherry picked from commit 6cc52c6)
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* Prevent deleting databases that have attached tables

Similar to logic preventing deleting tables that have charts attached.

* Addressing comments
@mistercrunch mistercrunch deleted the prevent_delete_db branch December 21, 2018 05:34
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants