superset
superset copied to clipboard
Event flow chart does not display Time section in configuration
When creating an 'event flow' chart in superset, the section labeled 'Time' is not displayed. This prevents the 'time column' select element from rendering, and prevents configuration of the chart. Attempts to configure a chart without filling in this section result in the error message:
Unexpected error Datetime column not provided as part table configuration and is required by this type of chart
Edit: After a bit of investigation, it appears that the time configuration section is rendered by the shared legacyRegularTime
section, which is disabled when GENERIC_CHART_AXES
is set. This suggests that this is therefor intended behaviour, and the bug instead lies with the propagation of the generic configuration through to the get_sqla_query
function.
Charts created in an earlier version of superset (2.0.0) can be imported, and will be rendered successfully, however they result in the same error as above if edited.
How to reproduce the bug
- Spin up and configure a superset docker container (I'm using 3.0.2)
- Import the examples with
docker exec -it superset superset load_examples
- Log in to superset
- Click on 'Charts'
- Click on '+ Chart'
- Click on 'Flow' > 'Event Flow'
- Select the 'Channels' data set
- Click 'Create new chart'
- The 'Time' section will not be visible
- If you attempt to configure the remainder of the chart, selecting
topic__creator
for 'Entity id', andname
for 'Event names' then click 'Create chart' you will see:
Unexpected error Datetime column not provided as part table configuration and is required by this type of chart
The same set of actions will work for Superset 2.0.0
Expected results
~I expect to have the ability to select created
under a 'Time Column' select box, which will allow an event flow chart to be created. This chart will show the flow of channel creation per topic__creator.~
I expect to be able to create an event flow chart. In the absence of an ability to explicitly configure time column settings, then the generic configuration should behave as intended.
Actual results
The time section of the configuration form is not rendered, preventing the selection of a Time column. This results in an error message when an attempt is made to create the chart.
Screenshots
Attached are screenshots of the process in superset 3.0.2, and superset 2.0.0
Superset 2.0.0
Superset 3.0.2
Environment
I'm using the container apache/supereset:3.0.2
- browser type and version: Vivaldi 6.4.3160.47 (Chromium)
- superset version: 3.0.2
- python version: Python 3.9.18
- node.js version:
node -v
(From within the docker container I get /bin/sh: 9: node: not found) - any feature flags active: No (Although GENERIC_CHART_AXES is on by default, and appears to be key to this behaviour)
Checklist
Make sure to follow these steps before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
See some issues within the docker logs:
2023-12-05 14:41:46 192.168.65.1 - - [05/Dec/2023:14:41:46 +0000] "GET /api/v1/me/ HTTP/1.1" 200 150 "http://localhost:8082/explore/?form_data_key=DQHTkqDFXtffWzPKYWWOvObk4We9PsomKjRATiDGy3sphErNjopkXo5Q-B40XmeH&viz_type=event_flow&datasource=20__table&datasource_id=20&datasource_type=table" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
2023-12-05 14:41:53 192.168.65.1 - - [05/Dec/2023:14:41:53 +0000] "GET /explore/?form_data_key=DQHTkqDFXtffWzPKYWWOvObk4We9PsomKjRATiDGy3sphErNjopkXo5Q-B40XmeH&viz_type=event_flow&datasource=20__table&datasource_id=20&datasource_type=table HTTP/1.1" 200 49991 "http://localhost:8082/superset/welcome/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
2023-12-05 14:41:53 HTTPException
2023-12-05 14:41:53 Traceback (most recent call last):
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
2023-12-05 14:41:53 rv = self.dispatch_request()
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request
2023-12-05 14:41:53 return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/scaffold.py", line 331, in send_static_file
2023-12-05 14:41:53 return send_from_directory(
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/helpers.py", line 590, in send_from_directory
2023-12-05 14:41:53 return werkzeug.utils.send_from_directory( # type: ignore[return-value]
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/werkzeug/utils.py", line 578, in send_from_directory
2023-12-05 14:41:53 raise NotFound()
2023-12-05 14:41:53 werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
2023-12-05 14:41:53 2023-12-05 14:41:53,194:WARNING:superset.views.base:HTTPException
2023-12-05 14:41:53 Traceback (most recent call last):
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
2023-12-05 14:41:53 rv = self.dispatch_request()
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request
2023-12-05 14:41:53 return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/scaffold.py", line 331, in send_static_file
2023-12-05 14:41:53 return send_from_directory(
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/helpers.py", line 590, in send_from_directory
2023-12-05 14:41:53 return werkzeug.utils.send_from_directory( # type: ignore[return-value]
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/werkzeug/utils.py", line 578, in send_from_directory
2023-12-05 14:41:53 raise NotFound()
2023-12-05 14:41:53 werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
2023-12-05 14:41:53 HTTPException
2023-12-05 14:41:53 Traceback (most recent call last):
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
2023-12-05 14:41:53 rv = self.dispatch_request()
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request
2023-12-05 14:41:53 return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/scaffold.py", line 331, in send_static_file
2023-12-05 14:41:53 return send_from_directory(
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/helpers.py", line 590, in send_from_directory
2023-12-05 14:41:53 return werkzeug.utils.send_from_directory( # type: ignore[return-value]
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/werkzeug/utils.py", line 578, in send_from_directory
2023-12-05 14:41:53 raise NotFound()
2023-12-05 14:41:53 werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
2023-12-05 14:41:53 2023-12-05 14:41:53,213:WARNING:superset.views.base:HTTPException
2023-12-05 14:41:53 Traceback (most recent call last):
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
2023-12-05 14:41:53 rv = self.dispatch_request()
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request
2023-12-05 14:41:53 return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/scaffold.py", line 331, in send_static_file
2023-12-05 14:41:53 return send_from_directory(
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/helpers.py", line 590, in send_from_directory
2023-12-05 14:41:53 return werkzeug.utils.send_from_directory( # type: ignore[return-value]
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/werkzeug/utils.py", line 578, in send_from_directory
2023-12-05 14:41:53 raise NotFound()
2023-12-05 14:41:53 werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
2023-12-05 14:41:53 192.168.65.1 - - [05/Dec/2023:14:41:53 +0000] "GET /static/appbuilder/select2/select2.css HTTP/1.1" 404 0 "http://localhost:8082/explore/?form_data_key=DQHTkqDFXtffWzPKYWWOvObk4We9PsomKjRATiDGy3sphErNjopkXo5Q-B40XmeH&viz_type=event_flow&datasource=20__table&datasource_id=20&datasource_type=table" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
2023-12-05 14:41:53 HTTPException
2023-12-05 14:41:53 Traceback (most recent call last):
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
2023-12-05 14:41:53 rv = self.dispatch_request()
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request
2023-12-05 14:41:53 return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/scaffold.py", line 331, in send_static_file
2023-12-05 14:41:53 return send_from_directory(
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/helpers.py", line 590, in send_from_directory
2023-12-05 14:41:53 return werkzeug.utils.send_from_directory( # type: ignore[return-value]
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/werkzeug/utils.py", line 578, in send_from_directory
2023-12-05 14:41:53 raise NotFound()
2023-12-05 14:41:53 werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
2023-12-05 14:41:53 2023-12-05 14:41:53,219:WARNING:superset.views.base:HTTPException
2023-12-05 14:41:53 Traceback (most recent call last):
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
2023-12-05 14:41:53 rv = self.dispatch_request()
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request
2023-12-05 14:41:53 return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/scaffold.py", line 331, in send_static_file
2023-12-05 14:41:53 return send_from_directory(
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/flask/helpers.py", line 590, in send_from_directory
2023-12-05 14:41:53 return werkzeug.utils.send_from_directory( # type: ignore[return-value]
2023-12-05 14:41:53 File "/usr/local/lib/python3.9/site-packages/werkzeug/utils.py", line 578, in send_from_directory
2023-12-05 14:41:53 raise NotFound()
2023-12-05 14:41:53 werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
2023-12-05 14:41:53 192.168.65.1 - - [05/Dec/2023:14:41:53 +0000] "GET /static/appbuilder/datepicker/bootstrap-datepicker.css HTTP/1.1" 404 0 "http://localhost:8082/explore/?form_data_key=DQHTkqDFXtffWzPKYWWOvObk4We9PsomKjRATiDGy3sphErNjopkXo5Q-B40XmeH&viz_type=event_flow&datasource=20__table&datasource_id=20&datasource_type=table" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
2023-12-05 14:41:53 192.168.65.1 - - [05/Dec/2023:14:41:53 +0000] "GET /static/appbuilder/select2/select2-bootstrap-theme.css HTTP/1.1" 404 0 "http://localhost:8082/explore/?form_data_key=DQHTkqDFXtffWzPKYWWOvObk4We9PsomKjRATiDGy3sphErNjopkXo5Q-B40XmeH&viz_type=event_flow&datasource=20__table&datasource_id=20&datasource_type=table" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
2023-12-05 14:41:54 192.168.65.1 - - [05/Dec/2023:14:41:54 +0000] "GET /api/v1/database/?q=(filters:!((col:database_name,opr:neq,value:examples))) HTTP/1.1" 200 521 "http://localhost:8082/explore/?form_data_key=DQHTkqDFXtffWzPKYWWOvObk4We9PsomKjRATiDGy3sphErNjopkXo5Q-B40XmeH&viz_type=event_flow&datasource=20__table&datasource_id=20&datasource_type=table" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
2023-12-05 14:41:54 192.168.65.1 - - [05/Dec/2023:14:41:54 +0000] "GET /api/v1/database/?q=(filters:!((col:allow_file_upload,opr:upload_is_enabled,value:!t))) HTTP/1.1" 200 521 "http://localhost:8082/explore/?form_data_key=DQHTkqDFXtffWzPKYWWOvObk4We9PsomKjRATiDGy3sphErNjopkXo5Q-B40XmeH&viz_type=event_flow&datasource=20__table&datasource_id=20&datasource_type=table" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
2023-12-05 14:41:54 192.168.65.1 - - [05/Dec/2023:14:41:54 +0000] "GET /api/v1/explore/?form_data_key=DQHTkqDFXtffWzPKYWWOvObk4We9PsomKjRATiDGy3sphErNjopkXo5Q-B40XmeH&viz_type=event_flow&datasource_id=20&datasource_type=table HTTP/1.1" 200 2389 "http://localhost:8082/explore/?form_data_key=DQHTkqDFXtffWzPKYWWOvObk4We9PsomKjRATiDGy3sphErNjopkXo5Q-B40XmeH&viz_type=event_flow&datasource=20__table&datasource_id=20&datasource_type=table" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
2023-12-05 14:41:54 192.168.65.1 - - [05/Dec/2023:14:41:54 +0000] "GET /api/v1/database/1/table_extra/channels/main/ HTTP/1.1" 200 3 "http://localhost:8082/explore/?form_data_key=DQHTkqDFXtffWzPKYWWOvObk4We9PsomKjRATiDGy3sphErNjopkXo5Q-B40XmeH&viz_type=event_flow&datasource=20__table&datasource_id=20&datasource_type=table" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
2023-12-05 14:41:54 Superset.explore_json This API endpoint is deprecated and will be removed in version 4.0.0
2023-12-05 14:41:54 2023-12-05 14:41:54,705:WARNING:superset.views.base:Superset.explore_json This API endpoint is deprecated and will be removed in version 4.0.0
2023-12-05 14:41:54 2023-12-05 14:41:54,721:DEBUG:parsedatetime:eval - with context - False, False
2023-12-05 14:41:54 Cache key: db81d61dbf5d30dce5e2f4f1609d33fd
2023-12-05 14:41:54 2023-12-05 14:41:54,743:INFO:superset.viz:Cache key: db81d61dbf5d30dce5e2f4f1609d33fd
2023-12-05 14:41:54 192.168.65.1 - - [05/Dec/2023:14:41:54 +0000] "POST /superset/explore_json/ HTTP/1.1" 400 1175 "http://localhost:8082/explore/?form_data_key=DQHTkqDFXtffWzPKYWWOvObk4We9PsomKjRATiDGy3sphErNjopkXo5Q-B40XmeH&viz_type=event_flow&datasource=20__table&datasource_id=20&datasource_type=table" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
2023-12-05 14:41:54 192.168.65.1 - - [05/Dec/2023:14:41:54 +0000] "GET /api/v1/chart/0 HTTP/1.1" 404 24 "http://localhost:8082/explore/?form_data_key=DQHTkqDFXtffWzPKYWWOvObk4We9PsomKjRATiDGy3sphErNjopkXo5Q-B40XmeH&viz_type=event_flow&datasource=20__table&datasource_id=20&datasource_type=table" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
2023-12-05 14:41:55 192.168.65.1 - - [05/Dec/2023:14:41:55 +0000] "POST /api/v1/explore/form_data?tab_id=1 HTTP/1.1" 201 75 "http://localhost:8082/explore/?form_data_key=DQHTkqDFXtffWzPKYWWOvObk4We9PsomKjRATiDGy3sphErNjopkXo5Q-B40XmeH&viz_type=event_flow&datasource=20__table&datasource_id=20&datasource_type=table" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
2023-12-05 14:41:55 192.168.65.1 - - [05/Dec/2023:14:41:55 +0000] "POST /superset/log/?explode=events HTTP/1.1" 200 1 "http://localhost:8082/explore/?form_data_key=DQHTkqDFXtffWzPKYWWOvObk4We9PsomKjRATiDGy3sphErNjopkXo5Q-B40XmeH&viz_type=event_flow&datasource=20__table&datasource_id=20&datasource_type=table" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
- [x] I have reproduced the issue with at least the latest released version of superset.
- [x] I have checked the issue tracker for the same issue and I haven't found one similar.
Additional context
Add any other context about the problem here.
Hey @JamesGlover I want to work on this issue. can you please assign it to me? Thank you!
@gauravruhela07 I'm not a maintainer, just an end-user reporting the issue, so am not able to assign issues.
@JamesGlover can you please tell me whom should I tag/ask to assign it to me?
Hello @rusackas, I'm sorry to bother you again. Could you kindly suggest us on assigning @gauravruhela07 as assignee to this issue?
Done a bit of probing into this one.
It appears that this chart uses the legacyRegularTime
section, which gets disabled when the feature flag GENERIC_CHART_AXES
is enabled.
Which suggests that the missing time section is intentional, and actually the problem here is that the generic axes options aren't being passed through to get_sqla_query
where the error message we see is actually generated. I'll update the report to reflect this.
Following a bit more analysis:
EventFlowViz.query_object
has a granularity
of None when not present in the form object, which triggers the error message when handles by get_sqla_query
. Adding:
if query["granularity"] is None:
query["granularity"] = ''
To this will resolve the issue, resulting in a fallback to the default timestamp. However I'm not familiar enough with the architecture of Superset to know what the correct fix actually is. I notice that a lot of this is going through legacy endpoints, so I'm assuming that the general direction is to update or replace these visualisations with versions using newer interfaces.
This PR fixes a similar issue on another chart by restoring the time section of the form in an ad-hoc manner:
https://github.com/apache/superset/pull/23865
anybody knows where this issue stands? I am unable to use the event flow chart at all
TBH, I'm going to propose deprecating the event flow chart as part of Superset 5.0. If anyone wants to make a modern replacement, that's great, but it seems like it's not used by many, and it's built with dependencies that are no longer maintained.
@villebro @michael-s-molina @Vitor-Avila Seems like 26705 didn't solve this issue. We are still facing the same issue in 3.1.2. Any work around would be much appreciated.
@mdeshmu There's a proposal in 5.0 to remove this chart as it's not compatible with React 17. Check here for more details.
thanks, @michael-s-molina! That's really good context 🙏 Seems like solving this specific bug doesn't make sense then, and instead a better option would be to recreate/upgrade this plugin to meet current needs/standards (leaving this comment here just as a potential suggestion for next steps if someone wants to tackle it)
Closing as won't fix.
@michael-s-molina @rusackas @Vitor-Avila We do need an alternate chart for event flow. Any suggestions?
@mdeshmu I don't think ECharts has anything similar. Maybe one could be built using a combination of ECharts charts or another library. Currently, we don't have anyone willing to create/maintain this chart as it's not frequently used.
I think it's even fair to say that the existing chart could be refactored... if it's updated to use the newer chart/data
endpoint, converted to typescript, and stripped of the problematic dependencies (data-ui
, if memory serves) then we can probably just keep it! Of course, I have NO idea how deep that rabbit hole goes...