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>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&
 nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](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 [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to