trino-python-client icon indicating copy to clipboard operation
trino-python-client copied to clipboard

Add variable precision time and timestamp support

Open lpoulain opened this issue 3 years ago • 5 comments

Add variable precision time and timestamp support for the experimental_python_types flag by passing the X-Trino-Client-Capabilities: PARAMETRIC_DATETIME header in the query request, just like the Trino JDBC and ODBC drivers do.

Updates the tests/integration/test_types_integration.py accordingly.

lpoulain avatar Aug 23 '22 17:08 lpoulain

one question - why can this new behaviour not be exposed for cursors without experimental_python_types=true?

hashhar avatar Aug 24 '22 13:08 hashhar

@lpoulain Can you please update behavior to match the JDBC driver (rounding instead of truncation)? Other than that (and possibly allowing using this with experimental_python_types disabled) this seems good to me.

hashhar avatar Aug 25 '22 14:08 hashhar

@hashhar done.

lpoulain avatar Aug 26 '22 11:08 lpoulain

@lpoulain Please try using fixup commits when addressing review comments otherwise it's impossible to see what changed between the force push and before that.

hashhar avatar Sep 14 '22 20:09 hashhar

@lpoulain : can you rebase your changes on latest master?

mdesmet avatar Sep 27 '22 12:09 mdesmet

Closing PR as too many things have changed since. Will file a new PR

lpoulain avatar Dec 13 '22 00:12 lpoulain