trinodb / trino-python-client

Python client for Trino
Apache License 2.0
311 stars 154 forks source link

Add variable precision time and timestamp support #229

Closed lpoulain closed 1 year ago

lpoulain commented 1 year ago

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.

hashhar commented 1 year ago

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

hashhar commented 1 year ago

@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.

lpoulain commented 1 year ago

@hashhar done.

hashhar commented 1 year ago

@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.

mdesmet commented 1 year ago

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

lpoulain commented 1 year ago

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