-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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: status 500 thrown when creating a dataset due to invalid sql #27796
base: master
Are you sure you want to change the base?
Conversation
4cc06fd
to
f0ddd44
Compare
Tested on my dev setup and confirm the Fatal error is turned into a Dataset could not be created. error. This is also a first step towards resolving #25786. |
Thanks @jzhao62 for the PR. Would you mind also adding some unit tests to prevent potential future regressions? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #27796 +/- ##
===========================================
+ Coverage 60.48% 83.48% +22.99%
===========================================
Files 1931 521 -1410
Lines 76236 37488 -38748
Branches 8568 0 -8568
===========================================
- Hits 46114 31297 -14817
+ Misses 28017 6191 -21826
+ Partials 2105 0 -2105
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@jzhao62 for running tests locally try:
these instructions should be outlined in |
Hey all, Just wondering if there's any hope of getting this across the finish line, as it would close both an open Discussion and an open Issue. |
hey @rusackas, i somewhat get stuck in the testing phase, where i cannot pass the celery integration tests from machine, i will address the conflicts and continue work on this |
8073bb0
to
04401c1
Compare
04401c1
to
7e214ca
Compare
@rusackas just wondering can someone kick start the test workflows, i highly suspect that the majority of testcases should work fine, i am seeking some help in the slack regarding at running test at meantime, |
great, seems no regression is introduced, i will add unit test for coverage on these line and it is a go. |
@jzhao62 fantastic, thanks for following through on this! 🙌 |
@rusackas hi, i have added unit test for coverage and this PR should be ready to go. if anything else let me know |
) | ||
return column_description | ||
|
||
except SupersetGenericDBErrorException as ex: |
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.
Why is this necessary? It seems like we're re-raising the previous error with the same error type.
except ( | ||
SQLAlchemyError, | ||
DAOCreateFailedError, | ||
SupersetGenericDBErrorException, |
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 suspect this line is actually what is relevant, i.e., the changes to superset/connectors.sqla/utils.py
are not necessary.
SUMMARY
previously when a dataset is being created, supersetGenericDB error can be thrown at the db_engine layer if a sql statement is invalid
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
before
before.mp4
after
after.mp4
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION