You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SavedQuery class seems to not have a name property, unlike other data sources.
Create chart workflow seems to expect that property on all data source types.
How to reproduce the bug
Assuming a database connection is available. I am using a BigQuery connection, but it's irrelevant to the issue.
Create a saved query request JSON (make sure to use the right database ID)
Curl command to complete successfully with the creation of the chart from the saved query.
Actual results
Curl result is {"message":"Fatal error"}
superset app stacktrace:
superset_app | 2023-02-24 12:15:23,974:ERROR:flask_appbuilder.api:'SavedQuery' object has no attribute 'name'
superset_app | Traceback (most recent call last):
superset_app | File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/api/__init__.py", line 110, in wraps
superset_app | return f(self, *args, **kwargs)
superset_app | File "/app/superset/views/base_api.py", line 124, in wraps
superset_app | raise ex
superset_app | File "/app/superset/views/base_api.py", line 115, in wraps
superset_app | duration, response = time_function(f, self, *args, **kwargs)
superset_app | File "/app/superset/utils/core.py", line 1586, in time_function
superset_app | response = func(*args, **kwargs)
superset_app | File "/app/superset/utils/log.py", line 266, in wrapper
superset_app | value = f(*args, **kwargs)
superset_app | File "/app/superset/views/base_api.py", line 87, in wraps
superset_app | return f(self, *args, **kwargs)
superset_app | File "/app/superset/charts/api.py", line 316, in post
superset_app | new_model = CreateChartCommand(item).run()
superset_app | File "/app/superset/charts/commands/create.py", line 44, in run
superset_app | self.validate()
superset_app | File "/app/superset/charts/commands/create.py", line 64, in validate
superset_app | self._properties["datasource_name"] = datasource.name
superset_app | AttributeError: 'SavedQuery' object has no attribute 'name'
superset_app | 172.20.0.1 - - [24/Feb/2023:12:15:23 +0000] "POST /api/v1/chart/ HTTP/1.1" 500 26 "-" "curl/7.81.0"
Screenshots
none
Environment
(please complete the following information):
browser type and version: -
superset version: master, 2.1.0rc1 (1.5.3 does not support saved query as data source for charts)
python version: Python 3.10.6
node.js version: -
any feature flags active: -
Checklist
Make sure to follow these steps before submitting your issue - thank you!
I have checked the superset logs for python stacktraces and included it here as text if there are any.
I have reproduced the issue with at least the latest released version of superset.
I have checked the issue tracker for the same issue and I haven't found one similar.
Additional context
Ubuntu 22.04, ran locally using docker compose.
I was lazy and used the cookie authentication from the browser, but it shouldn't matter wrt the problem.
The text was updated successfully, but these errors were encountered:
In 2.0.1 I get {"message":{"datasource_id":["Datasource does not exist"]}} even though the saved query exists and has the ID I pass to the create chart call.
Agreed, seems to be working as expected for a long while indeed. This is likely fixed by now, and is pretty out of date if not. If people are still encountering this in current versions (3.x) please open a new Issue or a PR to address the problem.
SavedQuery class seems to not have a
name
property, unlike other data sources.Create chart workflow seems to expect that property on all data source types.
How to reproduce the bug
Assuming a database connection is available. I am using a BigQuery connection, but it's irrelevant to the issue.
Expected results
Curl command to complete successfully with the creation of the chart from the saved query.
Actual results
Curl result is
{"message":"Fatal error"}
superset app stacktrace:
Screenshots
none
Environment
(please complete the following information):
-
master, 2.1.0rc1
(1.5.3
does not support saved query as data source for charts)Python 3.10.6
-
-
Checklist
Make sure to follow these steps before submitting your issue - thank you!
Additional context
Ubuntu 22.04, ran locally using docker compose.
I was lazy and used the cookie authentication from the browser, but it shouldn't matter wrt the problem.
The text was updated successfully, but these errors were encountered: