-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Conversation
Similar to logic preventing deleting tables that have charts attached.
superset/views/core.py
Outdated
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]))) |
There was a problem hiding this comment.
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)))
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 Report
@@ 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
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments (cherry picked from commit 6cc52c6)
* Prevent deleting databases that have attached tables Similar to logic preventing deleting tables that have charts attached. * Addressing comments
![screen shot 2018-08-27 at 5 41 32 pm](https://user-images.githubusercontent.com/487433/44694175-e310bb00-aa20-11e8-84d6-0956e128f964.png)
Similar to logic preventing deleting tables that have charts attached.