-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
fix missing datasource error message #5019
fix missing datasource error message #5019
Conversation
87156cb
to
cf374ef
Compare
Codecov Report
@@ Coverage Diff @@
## master #5019 +/- ##
==========================================
- Coverage 77.34% 77.34% -0.01%
==========================================
Files 44 44
Lines 8665 8668 +3
==========================================
+ Hits 6702 6704 +2
- Misses 1963 1964 +1
Continue to review full report at Codecov.
|
Should we cascade deleted datasource and delete the corresponding slice(s)? |
superset/views/core.py
Outdated
@@ -1229,7 +1229,10 @@ def datasource_info(datasource_id, datasource_type, form_data): | |||
datasource = form_data.get('datasource', '') | |||
if '__' in datasource: | |||
datasource_id, datasource_type = datasource.split('__') | |||
datasource_id = int(datasource_id) | |||
# The case where the datasource has been deleted | |||
datasource_id = None if datasource_id == 'None' else datasource_id |
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.
I don't understand how datasource_id == 'None'
comes into being in the first place. Can we catch the issue upstream?
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.
True. I was also confused at the beginning. datasource
evaluates to 'None__Table', so splitting that gets 'None'
. I'll investigate upstream.
@john-bodley In the case where I found the issue, the user wasn't aware the underlying datasource was missing. I think deleting would have been even more confusing. |
@john-bodley @mistercrunch Upon furthher investigation, I think the current approach is best for the following reaosns
|
Can we change the error message to something like "The data source associated with this chart no longer exists"? Also, should we raise right then (asap) instead of waiting for raising in |
About cascading, I think that would be the desired behavior as long as there's clarity on what is happening. There should be a confirmation screen with all the associated objects that are going to be deleted, and the person performing the operation should have write/delete access to all these objects. |
Agree with raising early. Done that. I agree with the cascading idea of forcing users to delete all dependent slices before deleting the datasource but I'll push it to a future PR. |
ae50763
to
f52f7aa
Compare
…_missing_datasource fix missing datasource error message
When a datasource is deleted, slices show a cryptic error message in image 1.
This PR fixes it so it shows a more intelligible error message as in image 2.
@john-bodley @michellethomas