bartoszx commented on issue #21267: URL: https://github.com/apache/superset/issues/21267#issuecomment-3045382651
# Superset does not recognize datetime column alias from Virtual Dataset as X-Axis Hi, Iām having what seems to be the exact same issue as described in https://github.com/apache/superset/issues/21267 ## Problem: I have a Virtual Dataset using a SQL query with a datetime alias: ```sql SELECT operator, FROM_UNIXTIME(slot_5min) AS slot_dt, MAX(request_time) AS max_request_time FROM requests GROUP BY operator, slot_dt ``` In Dataset > Columns, I have set the following for `slot_dt`: - Is temporal = true - Is dimension = true - Default datetime = true ## But in Explore (Bubble Chart / Scatter Plot): - `slot_dt` does not appear in X-Axis or Time Column - It shows up only in metrics (fx(...)) - I cannot plot by time ā it falls back to numeric axis (1.75e+12 format)  ## Workarounds tried: - Refresh dataset columns - Re-create chart from scratch - Clear browser cache - Create calculated column (still string) - Create view in database (fails) - Use physical DATETIME column in a raw table (fails too) - Tried all combinations ā none allow proper datetime usage on the X-Axis in Bubble Chart ## Setup: - Superset version: 5.0.0 (Docker, TAG=5.0.0) - Database: MariaDB 10.11.13 - Dataset: virtual (not physical table) ## Superset FEATURE_FLAGS: ```python FEATURE_FLAGS = { "GLOBAL_ASYNC_QUERIES": False, "ENABLE_TEMPLATE_REMOVE_FILTERS": True, "DASHBOARD_NATIVE_FILTERS": True, "DASHBOARD_NATIVE_FILTERS_SET": True, "ENABLE_EXPLORE_DRAG_AND_DROP": True, "ENABLE_DND_WITH_CLICK_UX": True, "OMNIBAR": True, "GENERIC_CHART_AXES": True, "DASHBOARD_CACHE": True, "ALERT_REPORTS": True, "ENABLE_TEMPLATE_PROCESSING": True, # optionally: "SQL_VALIDATORS_BY_ENGINE": { "mysql": "MySQLValidator", }, } ``` ## Expected: Column `slot_dt` should be treated as a proper DATETIME field and selectable in X-axis and time filter controls. Let me know if I can provide a dataset export, dashboard JSON, or steps to reproduce. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
