Fix Polars temporal column stats JSON serialization for tracker - #1675
Open
dgvj-work wants to merge 1 commit into
Open
Fix Polars temporal column stats JSON serialization for tracker#1675dgvj-work wants to merge 1 commit into
dgvj-work wants to merge 1 commit into
Conversation
dgvj-work
force-pushed
the
fix/polars-temporal-stats-json-safe
branch
2 times, most recently
from
August 1, 2026 05:45
a65d947 to
670e8f4
Compare
Datetime tracking for apache#1127 already avoids std(); extend the same datetime stats path so Time and Duration values serialize cleanly, and add a Datetime regression test matching the reported failure.
dgvj-work
force-pushed
the
fix/polars-temporal-stats-json-safe
branch
from
August 1, 2026 05:47
670e8f4 to
66cb544
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.
Make Polars temporal column stats JSON-safe and cover the #1127 Datetime regression.
Changes
datetime_column_statsconversion so Date/Datetime/Time/Duration values are JSON-serializable for the UIbase_data_type="datetime"(no new stats type)How I tested this
pytest ui/sdk/tests/tracking/test_polars_col_stats.py ui/sdk/tests/tracking/test_polars_stats.py(23 passed)pre-commit run ruff-check/ruff-formaton the touched files (passed)Notes
std()crash by routing throughdatetime_column_statswithstd=0.0, but Hamilton tracker gives an error with datetime columns in polars dataframes #1127 was still open: there was no regression test pinning that Datetime path, and Time/Duration values on the same path were still not JSON-serializable for the tracker payload. This PR closes that loop.Closes #1127
Checklist
Drafted with AI assistance (Cursor); I verified the serialization behavior against polars' temporal dtypes manually and reviewed all test assertions.