apache / apache/superset

ClickHouse DateTime64(3, 'timezone') columns coerced to UTC in Superset UI (worked in 4.1.1)

Open
#43,927 3 comments 0 reactions 0 assignees View on GitHub
#bug 🦾 ai-candidate
Dominant language
Python
Stars
74.8k
Forks
18.3k
Avg merge
2d 5h
Merged PRs (30d)
685

Description

### Bug description

### Bug description

In Superset 6.1.0, ClickHouse `DateTime64(3)` columns are displayed in UTC in the UI rather than matching the database local time (a regression compared to version 4.1.1).

Furthermore, when attempting to compensate for this display shift using the **Hours Offset** setting in the dataset configuration, the API rejects non-integer values (such as `3.5` for a `+03:30` timezone) with a schema validation error.

### How to reproduce the bug

1. In ClickHouse, define or alter a timestamp column with an explicit timezone:
```sql
DateTime64(3, 'Asia/Tehran')
2. Verify in ClickHouse that the timestamps display in local time (+03:30).
3. Connect the table to Superset and view it in Explore or a Table chart: the timestamps are coerced and displayed in UTC instead of the specified timezone.
4. Go to **Datasets** → **Edit Dataset** → **Settings**.
5. Set **Hours Offset** to a non-integer value (e.g., `3.5`).
6. Click **Save**.
7. Observe the schema validation error:
```text
Error Saving dataset
the schema of the submitted payload is invalid.
not a valid integer.: 3.5

Details:
offset: [] 1 item
0: "Not a valid integer."

### Expected results

- The ClickHouse temporal display behavior should match the database or earlier versions (e.g., Superset 4.1.1).
- The dataset **Hours Offset** schema should support floating-point/decimal values (e.g., `3.5`, `5.5`) to accommodate non-integer UTC offsets.

### Actual results

- Timestamps display strictly in UTC in the UI.
- Setting a fractional offset in **Hours Offset** fails schema validation because the dataset endpoint expects an integer.

### Environment

- **Superset version**: `6.1.0`
- **Feature flags**: `N/A`
- **Database driver/backend**: ClickHouse (`DateTime64(3, 'Asia/Tehran')`)
- **Deployment environment**: Docker Compose

### Checklist

- [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
- [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

- Prior working version: Superset 4.1.1 displayed the timestamps correctly.
- Setting container environment variables (`TZ`) or mounting `/etc/localtime` only affects application logs and datepicker filters, not the data values displayed in charts.

### Screenshots/recordings

Image
Image
Image

### Superset version

6.1.0

### Python version

3.11

### Node version

I don't know

### Browser

Chrome

### Additional context

_No response_

### Checklist

- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [ ] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Contributor guide

Open the contributing guide

Research direction

No source files or tests are named. Reproduce the ClickHouse DateTime64(3, 'Asia/Tehran') case and the fractional Hours Offset validation failure first, then trace the dataset schema and timestamp display paths. Done means timezone-qualified values retain their intended display behavior and offsets such as 3.5 or 5.5 save successfully without schema errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
clickhouse, python
Domain
api, data-visualization, databases, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.