Skip to content

fix: coerce tz-aware datetimes to naive for timezone=False columns#2

Merged
simozzy merged 1 commit into
mainfrom
fix/naive-datetime-coercion
Jun 18, 2026
Merged

fix: coerce tz-aware datetimes to naive for timezone=False columns#2
simozzy merged 1 commit into
mainfrom
fix/naive-datetime-coercion

Conversation

@simozzy

@simozzy simozzy commented Jun 18, 2026

Copy link
Copy Markdown
Member

Fixes the datetime/timestamp/interval compliance-suite failures (tz-aware UTC vs naive) by stripping tzinfo for timezone=False columns in DatabendDateTime.result_processor. timezone=True columns stay aware. Adds a server-less unit test covering aware/naive/None/string inputs.

The CI image pin has been dropped — the floating :nightly tag is the only channel Databend publishes (there is no stable non-nightly tag), and keeping it preserves @rad-pat's early-warning on upstream drift. The dialect fix is what makes the suite green against nightly, not a frozen server. If upstream drift starts gating unrelated PRs, we can add a pinned job + scheduled :nightly canary in a focused follow-up.

🤖 Generated with Claude Code

@simozzy simozzy requested a review from rad-pat June 18, 2026 20:39

@rad-pat rad-pat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nightly is there so that tests always run against the latest Databend somthat failures are found early

@simozzy

simozzy commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

@rad-pat Thanks. just seeing CI errors on a related PR, so wasn't sure what to do.

Should I close this?

@simozzy

simozzy commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

#1

Newer Databend drivers return tz-aware (UTC) datetimes. A plain
DateTime()/TIMESTAMP column (timezone=False) must yield naive values to
honour SQLAlchemy's typing contract, which is what the compliance
suite's naive datetime/timestamp/interval round-trips assert. Normalise
to UTC and drop tzinfo in DatabendDateTime.result_processor for
timezone=False columns; timezone=True columns stay aware. Adds a
server-less unit test covering aware/naive/None/string inputs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@simozzy simozzy force-pushed the fix/naive-datetime-coercion branch from f56e4fe to ab56a51 Compare June 18, 2026 21:08
@simozzy simozzy changed the title fix: coerce tz-aware datetimes to naive; pin CI databend image fix: coerce tz-aware datetimes to naive for timezone=False columns Jun 18, 2026
@simozzy

simozzy commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

@rad-pat Dropped the pin.

@simozzy simozzy requested a review from rad-pat June 18, 2026 21:10
@rad-pat

rad-pat commented Jun 18, 2026

Copy link
Copy Markdown
Member

Just FYI, if we wanna use these going forward then they need to be opened to databend/databend-sqlalchemy

@simozzy

simozzy commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

@rad-pat FYI - thanks for the FYI :)

@simozzy simozzy merged commit 526071a into main Jun 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants