Release dates, binaries, and other information for the Trino Python client are available in the tags list, the README and the PyPI page.
- Make this package PEP-561 compatible by adding a
py.typedmarker. (#514) - Ignore primary key, foreign key and unique constraints for table DDL generation. (#541)
- Fix SQLAlchemy function compilation for
first_value,last_value,nth_value,lead, andlag. (#586) - Make
lz4andzstandardoptional dependencies. The client now gracefully handles missing or broken compression libraries by disabling the corresponding encoding. (#585)
- Fix user impersonation support. (#568)
- Fix importing
get_localzone_namefor oldtzlocalversions. (#574) - Use faster JSON implementation (
orjson) for compatible Python runtimes. (#576)
- Fix connection scheme being incorrectly inferred as HTTP. (#557)
- Allow authentication over insecure channel. (#530)
- Add support for
withstatement withCursorclass. (#537) - Fix
KeyErrorwhen accessing missingerror_locationinTrinoQueryError. (#535). - Add support for
SET AUTHORIZATIONandRESET AUTHORIZATIONstatements. (#551) - Use default TLS port when URI scheme is
https. (#549) - Fix redirect URI not getting printed during OAuth authentication when using terminals that buffer output. (#548)
- Use TLS verification mode set on the connection when retrieving spooled results. (#546)
- Improve handling of query results containing
nullvalues for the error field. (#512) - Fix accessing spooled segments on S3 when authentication to the Trino cluster is used. (#525)
- Simplify
segmentcursor API to make it easier to iterate over spooled segments. (#525)
- Add support for spooling protocol. (#509)
- 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 MONTHtype by mapping to Pythonrelativedelta. (#475) - Add support for Trino
INTERVAL DAY TO SECONDtype 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_castto SQLAlchemy dialect. (#473) - Add retries on HTTP 429 error from Trino or a gateway/proxy using the
Retry-AfterHTTP header in the response. (#457) - Fix token caching for long tokens on Windows. (#477)
- Fix parsing of multi-valued
WWW-AuthenticateHTTP headers. (#484) - Fix SQLAlchemy
get_indexesimplementation to return partition column names for Hive connector instead of returning column names of the<table>$partitionstable. (#476) - Fix parsing of
certandkeyfrom 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
ROWandARRAYDDL 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
JSONdata type to SQLAlchemy dialect. (#387) - Add support for
IGNORE NULLSin window functions when using SQLAlchemy. (#429) - Add support for
MAPtype to SQLAlchemy dialect. (#397) - Add support for per-user OAuth2 token cache if the
useris provided when creating the connection. Ifuseris 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.Keyringto disable keyring when using OAuth2. (#431) - Fix
fetchallreturning already returned rows if called afterfetchoneorfetchmany. (#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_indexesin SQLAlchemy to not fail when called for non-Hive tables. (#426) - Fix reading and writing
MAPtypes with boolean or integer keys. (#441) - Fix incompatibility when using trino-python-client with Ray. (#420)
- Implement
get_catalog_namesfor SQLAlchemy to get the list of catalogs present on the cluster. (#401) - Use
OAuth2AuthenticationifexternalAuthenticationparameter is set on the connection url when using SQLAlchemy. (#343) - Set the
User-AgentHTTP header in all requests toTrino Python Client/<client_version>. (#411) - Raise
TrinoConnectionErrorfor all connection related errors. (#364)
- Fix SQLAlchemy URL failing to parse if
legacy_prepared_statementsparameter was specified. (#380) - Fix more than required
EXECUTE IMMEDIATEqueries being executed whenlegacy_prepared_statementsparameter wasn't explicitly set. (#380)
- Queries with parameters now uses
EXECUTE IMMEDIATEinstead ofPREPARE,EXECUTEandDEALLOCATEif the server supportsEXECUTE IMMEDIATE. IfEXECUTE IMMEDIATEis not support the client falls back to usingPREPARE,EXECUTEandDEALLOCATE. If you want to always usePREPARE,EXECUTEandDEALLOCATEset the kwarglegacy_prepared_statementstoTrue. (#375)
- Reduce the number of times
SELECT version()query is sent to Trino when using SQLAlchemy. (#371) - Fix
TIMESTAMP WITH TIME ZONEbeing mapped to incorrect zones. (#366)
- Fix handling of
Decimalparams which use scientific notation. (#347) - Map Trino
UUIDtype to Pythonuuid.UUID. (#354) - Map
sqlalchemy.Uuidtype to TrinoUUID. (#359) - Support using timezone aware
datetime.timeparams in prepared statements. (#360) - Allow accessing
ROWtype fields using their names in addition to their indices. (#338) - Interpret
roleswithout catalog name as system roles for convenience. (#341)
- Return
rowcountproperty on the DB-APICursorwhen available. (#325) - Provide a read-only property
queryon the DB-APICursorwhich contains the query text submitted through the cursor when available. (#323) - Automatically determine
http_scheme,hostandportfromhostif 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
varbinaryquery parameters. (#299) - Add
Cursor.describemethod to return some metadata about the results of a query. (#302) - Add
internal_size,precisionandscaleinCursor.description. (#315) - Add support for chaining methods on
Cursor.execute. (#279) - Fix bug where passing
rolestoConnectiondid 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=Trueto thetrino.dbapi.connectmethod. To restore the old behaviour of mapping results to primitive types you can passlegacy_primitive_types=Trueto thetrino.dbapi.connectmethod. 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.connectwhen 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
Nonevalues in array, map and row types whenexperimental_python_typesis enabled. (#269) - Expose query id of most recently executed query on a cursor as
Cursor.query_id. (#295)
- Improve the performance of
get_view_namesin SQLAlchemy. (#267) - Fix possible
ValueErrorwhen client receives empty HTTP headers. (#262) - Fix a compatibility issue with
_rfc_1738_quotein 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
KeyErrorwhen using prepared statements. (#249) - Fix failure when calling
get_table_commentusing SQLAlchemy. (#253)
- Add support for creating tables containing
JSONcolumns 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
roleskeyword argument totrino.dbapi.connect. (#230) - Add support for setting roles by adding the
rolesURL 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.URLto 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
TableClauseby not performing catalog lookup. (#237) - Fix errors when using prepared statements with Trino versions greater than or equal to 398. (#242)
- Block the
executemethod of the cursor until at least one row is received. Users no longer need to callfetchoneorfetchallto ensure query starts executing on the Trino server. Note that results still need to be consumed by callingfetchoneorfetchallto 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_catalogargument to SQLAlchemyTableobjects. (#186) - Improve performance when a cursor with
experimental_python_typesis used. (#206) - Fix incorrect results for
get_table_commentin 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.