Skip to content

Fix Arrow datetime conversion for SQL literal binds - #833

Open
00200200 wants to merge 2 commits into
kvesteri:masterfrom
00200200:codex/arrow-literal-bind
Open

00200200 wants to merge 2 commits into
kvesteri:masterfrom
00200200:codex/arrow-literal-bind

Conversation

@00200200

@00200200 00200200 commented Oct 3, 2026 •

Copy link
Copy Markdown

Fixes #798.

EnrichedDateTimeType.process_literal_param currently returns the original value instead of using the existing datetime conversion. With Arrow values, dialect-specific DateTime literal processors can fail to compile the expression. With aware datetime values, the literal can also bypass the UTC conversion used by bound parameters.

Reuse process_bind_param so the underlying DateTime literal processor receives the same converted datetime as normal parameter binding. This also keeps Pendulum literal compilation consistent with its existing bind behavior.

Regression coverage:

• ArrowType and EnrichedDateTimeType with Arrow processing.
• Arrow/Pendulum objects, native aware datetime values, and supported ISO strings.
• Both timezone settings and SQLite, PostgreSQL, MySQL, and MSSQL dialect compilation; no live servers required for these cases.
• 48 Arrow cases and 24 Pendulum cases fail before the fix and pass afterward.

Verification: 95 tests passed across the four affected datetime type test files; 3 PostgreSQL-dependent tests were deselected because no PostgreSQL server was available. Ruff lint, repository format check, and diff check passed. The complete database-backed suite was not run, and the issue-specific Firebird dialect was not tested locally.

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.

Cannot compile statement with ArrowType columns, when using both dialect=engine.dialect and compile_kwargs={"literal_binds": True}

1 participant