Release dates, binaries, and other information for the Trino Python client are available in the tags list, the README and the PyPI page.
- Add support for Python 3.13 and drop support for Python 3.8 which is end-of-life. (#489)
- Add support for Trino
INTERVAL YEAR TO MONTH
type by mapping to Pythonrelativedelta
. (#475) - Add support for Trino
INTERVAL DAY TO SECOND
type by mapping to Pythontimedelta
. (#475) - Custom types are now pickle-able which allows frameworks like Streamlit to work. (#490)
- Fix OAuth2 authentication to not fail if the redirect server or token server URIs contain parameters. (#495)
- Add support for
try_cast
to SQLAlchemy dialect. (#473) - Add retries on HTTP 429 error from Trino or a gateway/proxy using the
Retry-After
HTTP header in the response. (#457) - Fix token caching for long tokens on Windows. (#477)
- Fix parsing of multi-valued
WWW-Authenticate
HTTP headers. (#484) - Fix SQLAlchemy
get_indexes
implementation to return partition column names for Hive connector instead of returning column names of the<table>$partitions
table. (#476) - Fix parsing of
cert
andkey
from SQLAlchemy connection URI. (#478)
- Add support for
SET SESSION AUTHORIZATION
. (#349) - Add support for GSSAPI based Kerberos authentication. Use
auth=GSSAPIAuthentication(...)
to use it. (#454) - Add support to SQLAlchemy dialect for
ROW
andARRAY
DDL generation. (#458) - Fix possible OAuth2 authentication failures when identity providers return multiple challenges. (#444)
- Add support for Python 3.12 and drop support for Python 3.7 and PyPy 3.8 which are end-of-life. (#438)
- Add support for
JSON
data type to SQLAlchemy dialect. (#387) - Add support for
IGNORE NULLS
in window functions when using SQLAlchemy. (#429) - Add support for
MAP
type to SQLAlchemy dialect. (#397) - Add support for per-user OAuth2 token cache if the
user
is provided when creating the connection. Ifuser
is not provided the previous behaviour of a per-host token cache is used. (#430) - Add support to configure log level for all modules via the root logger. The
root logger is named
trino
. (#434) - Allow using
keyring.backends.null.Keyring
to disable keyring when using OAuth2. (#431) - Fix
fetchall
returning already returned rows if called afterfetchone
orfetchmany
. (#414) - Fix possible failures when retrieving query results if the server returns empty data. (#443)
- Fix error when closing a cursor without executing a query. (#428)
- Fix
get_indexes
in SQLAlchemy to not fail when called for non-Hive tables. (#426) - Fix reading and writing
MAP
types with boolean or integer keys. (#441) - Fix incompatibility when using trino-python-client with Ray. (#420)
- Implement
get_catalog_names
for SQLAlchemy to get the list of catalogs present on the cluster. (#401) - Use
OAuth2Authentication
ifexternalAuthentication
parameter is set on the connection url when using SQLAlchemy. (#343) - Set the
User-Agent
HTTP header in all requests toTrino Python Client/<client_version>
. (#411) - Raise
TrinoConnectionError
for all connection related errors. (#364)
- Fix SQLAlchemy URL failing to parse if
legacy_prepared_statements
parameter was specified. (#380) - Fix more than required
EXECUTE IMMEDIATE
queries being executed whenlegacy_prepared_statements
parameter wasn't explicitly set. (#380)
- Queries with parameters now uses
EXECUTE IMMEDIATE
instead ofPREPARE
,EXECUTE
andDEALLOCATE
if the server supportsEXECUTE IMMEDIATE
. IfEXECUTE IMMEDIATE
is not support the client falls back to usingPREPARE
,EXECUTE
andDEALLOCATE
. If you want to always usePREPARE
,EXECUTE
andDEALLOCATE
set the kwarglegacy_prepared_statements
toTrue
. (#375)
- Reduce the number of times
SELECT version()
query is sent to Trino when using SQLAlchemy. (#371) - Fix
TIMESTAMP WITH TIME ZONE
being mapped to incorrect zones. (#366)
- Fix handling of
Decimal
params which use scientific notation. (#347) - Map Trino
UUID
type to Pythonuuid.UUID
. (#354) - Map
sqlalchemy.Uuid
type to TrinoUUID
. (#359) - Support using timezone aware
datetime.time
params in prepared statements. (#360) - Allow accessing
ROW
type fields using their names in addition to their indices. (#338) - Interpret
roles
without catalog name as system roles for convenience. (#341)
- Return
rowcount
property on the DB-APICursor
when available. (#325) - Provide a read-only property
query
on the DB-APICursor
which contains the query text submitted through the cursor when available. (#323) - Automatically determine
http_scheme
,host
andport
fromhost
if it's a valid URL. (#340) - Fix query cancellation to follow the protocol. Before this change cancelling a query could lead to errors from the Trino server. (#328)
- Add support for SQLAlchemy 2.0. (#307)
- Add support for
varbinary
query parameters. (#299) - Add
Cursor.describe
method to return some metadata about the results of a query. (#302) - Add
internal_size
,precision
andscale
inCursor.description
. (#315) - Add support for chaining methods on
Cursor.execute
. (#279) - Fix bug where passing
roles
toConnection
did not enable the provided roles. (#311)
- The client now maps query results to Python types by default. In older
versions this could be enabled explicitly by passing
experimental_python_types=True
to thetrino.dbapi.connect
method. To restore the old behaviour of mapping results to primitive types you can passlegacy_primitive_types=True
to thetrino.dbapi.connect
method. See the documentation to learn more. (#305) - Add support for setting the session timezone. When not set explicitly it
defaults to the client side local timezone. This changes the behaviour of the
client in backward-incompatible way. To preserve the behaviour from client
versions older than 0.321.0 you can explicitly pass
timezone='UTC'
totrino.dbapi.connect
when creating the connection. (#27) - Add support for variable precision datetime types. This change makes temporal types contain the correct precision as computed by Trino instead of being always limited to millisecond precision. (#300)
- Fix handling of expired access tokens when using OAuth 2 authentication. (#284)
- Support
None
values in array, map and row types whenexperimental_python_types
is enabled. (#269) - Expose query id of most recently executed query on a cursor as
Cursor.query_id
. (#295)
- Improve the performance of
get_view_names
in SQLAlchemy. (#267) - Fix possible
ValueError
when client receives empty HTTP headers. (#262) - Fix a compatibility issue with
_rfc_1738_quote
in SQLAlchemy v1.4.42. (#273) - Return only tables in SQLAlchemy
get_table_names
. Previously, it also contained views. (#266)
- Fix the SQLAlchemy dialect to be compatible with SQLAlchemy 1.3.x versions. (#250)
- Fix possible
KeyError
when using prepared statements. (#249) - Fix failure when calling
get_table_comment
using SQLAlchemy. (#253)
- Add support for creating tables containing
JSON
columns and reading and writing to them with SQLAlchemy. (#194) - Add support for setting roles by passing a dictionary of catalog name and
role as the
roles
keyword argument totrino.dbapi.connect
. (#230) - Add support for setting roles by adding the
roles
URL query parameter in SQLAlchemy connections to a JSON object with keys as the catalog name and values as the role name. (#230) - Add a function
trino.sqlalchemy.URL
to generate SQLAlchemy URLs which properly handles escaping and encoding values where needed. (#235) - Fix query failures not being propagated to the client when using
fetchone
. (#95) - Fix queries returning a single row from sometimes appearing as failed on the server. (#220)
- Fix query failures when using SQLAlchemy
TableClause
by not performing catalog lookup. (#237) - Fix errors when using prepared statements with Trino versions greater than or equal to 398. (#242)
- Block the
execute
method of the cursor until at least one row is received. Users no longer need to callfetchone
orfetchall
to ensure query starts executing on the Trino server. Note that results still need to be consumed by callingfetchone
orfetchall
to ensure that a query isn't considered idle and terminated on the server. (#232)
- Add support for SQLAlchemy queries to access multiple catalogs by specifying
a
trino_catalog
argument to SQLAlchemyTable
objects. (#186) - Improve performance when a cursor with
experimental_python_types
is used. (#206) - Fix incorrect results for
get_table_comment
in SQLAlchemy when two tables with the same name and schema exist in different catalogs. (#217) - Remove spurious logging of HTTP responses when a query is cancelled. (#216)
Details for older releases are available in the tags list, the code itself, and the README documentation.