You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Tuinf1 (via GitHub)" <gi...@apache.org> on 2025/09/26 03:33:10 UTC
[D] Cannot change data type to date [superset]
GitHub user Tuinf1 created a discussion: Cannot change data type to date
From the sample data
https://raw.githubusercontent.com/apache-superset/examples-data/master/tutorial_flights.csv
https://superset.apache.org/docs/6.0.0/using-superset/exploring-data
<img width="909" height="256" alt="2" src="https://github.com/user-attachments/assets/cb5e891a-9622-49f3-800b-a3e4f267b9bf" />
<img width="786" height="435" alt="1" src="https://github.com/user-attachments/assets/08b1bc28-3469-49a9-b44b-f51a47ad3725" />
Why can't I change the data type to date if the data is "%Y-%m-%d"
The SQL expression doesn't change the data, and the "time" panel doesn't appear.
GitHub link: https://github.com/apache/superset/discussions/35301
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Cannot change data type to date [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] edited a comment on the discussion: Cannot change data type to date
<!-- Greeting -->
Hi @Tuinf1! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team.
<!-- Answer -->
Superset only enables the "time" panel if a column is explicitly marked as temporal in the dataset metadata (the `is_dttm` property). Using a SQL expression like `CAST()` or `TO_DATE()` in a calculated column does not change the underlying column's type or its temporal status, so the "time" panel won't appear.
To have Superset recognize a column as a date/time and enable time-based features, you need to either:
- Specify the column as a date during CSV upload using the "column_dates" option (now a dropdown in recent versions), or
- Edit the dataset schema after upload and mark the relevant column as temporal (set as "is temporal" in the UI).
After making this change, refresh the dataset so the UI picks up the update. Only columns marked this way will trigger the "time" panel and time-based controls in Explore. This process is metadata-driven and not affected by SQL expressions or calculated columns in the dataset config.
[Reference](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/databases/schemas.py)
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=d4b479bb-35a8-43c0-a6cc-86718bb98af7) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/35301#discussioncomment-14517452
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Cannot change data type to date [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: Cannot change data type to date
<!-- Greeting -->
Hi @Tuinf1! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team.
<!-- Answer -->
Superset only enables the "time" panel if a column is explicitly marked as temporal in the dataset metadata (the `is_dttm` property). Using a SQL expression like `CAST()` or `TO_DATE()` in a calculated column does not change the underlying column's type or its temporal status, so the "time" panel won't appear.
To have Superset recognize a column as a date/time and enable time-based features, you need to either:
- Specify the column as a date during CSV upload using the "column_dates" option (now a dropdown in recent versions), or
- Edit the dataset schema after upload and mark the relevant column as temporal (set as "is temporal" in the UI).
After making this change, refresh the dataset so the UI picks up the update. Only columns marked this way will trigger the "time" panel and time-based controls in Explore. This process is metadata-driven and not affected by SQL expressions or calculated columns in the dataset config.
[Reference](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/databases/schemas.py)
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/d4b479bb-35a8-43c0-a6cc-86718bb98af7?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/d4b479bb-35a8-43c0-a6cc-86718bb98af7?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/d4b479bb-35a8-43c0-a6cc-86718bb98af7?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/d4b479bb-35a8-43c0-a6cc-86718bb98af7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d4b479bb-35a8-43c0-a6cc-86718bb98af7?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/d4b479bb-35a8-43c0-a6cc-86718bb98af7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d4b479bb-35a8-43c0-a6cc-86718bb98af7?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&
nbsp;[](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/35301)
GitHub link: https://github.com/apache/superset/discussions/35301#discussioncomment-14517452
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org