Repository navigation
Display DATE and TIME transform scalars - #2491
Merged
rolandwalker merged 1 commit intoDec 2, 2026
Merged
rolandwalker merged 1 commit into
rolandwalker merged 1 commit into
Conversation
Contributor
|
Lovely thank you! |
rolandwalker
approved these changes
Dec 2, 2026
Contributor
Author
Thank you @rolandwalker |
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.
This PR fixes issue #2490.
Description
A
.|transform that returns a single DATE or TIME value, such asSELECT d FROM t .| df['d'].max(), printed "Nothing could be displayed for return type: <class 'datetime.date'>" (ordatetime.time). DATETIME, TIMESTAMP and TIME-as-timedelta values already showed as a one-row table._is_coerceable_scalarish()listeddatetime.datetimeanddatetime.timedeltabut notdatetime.dateordatetime.time, the types mycli's decoders produce for DATE and TIME columns. This change adds those two types, so these scalars take the same path as the other scalars and show as a one-row table.Tests in
mycli_test/pytests/test_polars_transform.py:test_run_polars_transform_coerces_temporal_scalar_to_dataframe:max()over date, time, datetime and timedelta values with real Polars.test_run_polars_transform_coerces_cursor_temporal_scalar_to_dataframe: the same through a mockedCursorwithFIELD_TYPE.DATEandFIELD_TYPE.TIME(the explicit-schema path real results take), including a NULL row.The date and time cases fail on main and pass with the change. Locally (Python 3.12, polars 2.1.0):
pytest mycli_test/pytests3714 passed, 88 skipped, 7 xfailed;ruff check,ruff formatandmypy --install-types .clean. The behave tests need a MySQL server and were not run.Fixes #2490
Checklist
changelog.mdfile.mycli/AUTHORS.txtfile (or it's already there).