Fix: preserve microsecond precision in datetime parameter binding (legacy #70)#89
Open
HenryNebula wants to merge 4 commits intodevfrom
Open
Fix: preserve microsecond precision in datetime parameter binding (legacy #70)#89HenryNebula wants to merge 4 commits intodevfrom
HenryNebula wants to merge 4 commits intodevfrom
Conversation
a5554b8 to
432d3dc
Compare
…gacy #70) The fallback path's _to_java() was dropping microseconds when converting Python datetime to java.sql.Timestamp (%S instead of %S.%f), and time.isoformat() could produce fractional seconds that java.sql.Time rejects. Also adds regression tests for datetime/date/time parameter binding in both mock and integration test suites. Closes #88 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Trino truncates to millisecond precision, Oracle returns datetime for DATE columns. Relax assertions to compare at second-level precision and accept both date/datetime forms. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Oracle's JDBC driver returns TIME columns as datetime(1970,1,1,HH,MM,SS) instead of a pure time object. Relax the time assertion to check hour/minute/second components regardless of the wrapping type. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
432d3dc to
9ed78b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #88: Python datetime/date/time parameter binding had precision and compatibility issues in the fallback JDBC path.
Changes
_to_java()fordatetime.datetime: Include fractional seconds (%S.%f) sojava.sql.Timestamppreserves microsecond precision instead of truncating to whole seconds_to_java()fordatetime.time: Use explicit%H:%M:%Sformat instead ofisoformat(), sincejava.sql.Time.valueOf()rejects fractional seconds and would crash ontimeobjects with microsecondsTest plan
Closes #88
Generated with Claude Code