-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
superset.views.datasource.views.Datasource does not implement a response_400 #18993
Comments
Hi @cancan101, I tested this issue on the latest master. The database table containing Legacy FAB UINewest UI |
So it looks like #18056 did fix the rison encoding meaning that the 400 error is no longer generated by that code path. That being said, if something else does generate a 400 error at some point the view does not correctly handle it and will then raise an error that |
Hi @cancan101, thanks for the debug. Today, I tested the endpoint in my local test environment. It looks works. |
I just ran this: curl 'http://127.0.0.1:8088/datasource/external_metadata_by_name/?q=(database_name:SWAPI,datasource_type:table,schema_name:main,table_name:allSpecies?foo=1)' .... (omitting the full curl line)
and this is a this is running against master. |
@cancan101 You should quote the table_name with single quotation.
|
Right , I intentionally misquoted it to be consistent with the prior broken rison escaping logic. That logic is now fixed in Master however this endpoint should return a 400 error not a 500 error in the case of a malformed query param. |
Hi @cancan101, Thanks for pointing this out. The endpoint I think we have 2 ways to fix this.
@dpgaspar What do you think about this issue? |
@zhaoyongjie We're doing some work on the dataset models and apis. I think we can take this on and migrate the datasource api to v1, which would use the restApi base model. |
Check if your dataset name contains special characters, like "&". |
Also tagging @hughhhh here since I know he's working on some API V1 refactors/migration currently. |
Closing this as stale since it's been silent for so long, and we're trying to steer toward a more actionable Issues backlog. If people are still encountering this in current versions (currently 3.x) please re-open this issue, open a new Issue with updated context, or raise a PR to address the problem. Thanks! |
When this error handler is hit:
https://github.com/dpgaspar/Flask-AppBuilder/blob/2d505e819d496308a34c5f623d70331a37599cc4/flask_appbuilder/api/__init__.py#L145-L146 in the
superset.views.datasource.views.Datasource
view, a a further Exception is raised as there is no 400 handler for that view:How to reproduce the bug
=
in its nameExpected results
Ideally it should handle the table name (it looks like the string is not properly
rison
encoded. If it isn't going to allow these strings, then at the very least the 400 error should be properly generatedActual results
A toast showing: "'Datasource' object has no attribute 'response_400'"
Screenshots
The dataset:
The error toast:
Environment
(please complete the following information):
Superset 1.4.1
Python 3.7.3
v15.4.0
Checklist
Make sure to follow these steps before submitting your issue - thank you!
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: