Skip to content

Release notes 0.334.0 #555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ list](https://github.com/trinodb/trino-python-client/tags), the
[README](https://github.com/trinodb/trino-python-client/blob/master/README.md)
and the [PyPI page](https://pypi.org/project/trino/).


## Release 0.334.0

* Allow authentication over insecure channel.
([#530](https://github.com/trinodb/trino-python-client/pull/530))
* Add support for `with` statement with `Cursor` class.
([#537](https://github.com/trinodb/trino-python-client/pull/537))
* Fix `KeyError` when accessing missing `error_location` in `TrinoQueryError`.
([#535](https://github.com/trinodb/trino-python-client/pull/535)).
* Add support for `SET AUTHORIZATION` and `RESET AUTHORIZATION` statements.
([#551](https://github.com/trinodb/trino-python-client/pull/551))
* Use default TLS port when URI scheme is `https`.
([#549](https://github.com/trinodb/trino-python-client/pull/549))
* Fix redirect URI not getting printed during OAuth authentication when using terminals that buffer output.
([#548](https://github.com/trinodb/trino-python-client/pull/548))
* Use TLS verification mode set on the connection when retrieving spooled results.
([#546](https://github.com/trinodb/trino-python-client/pull/546))

## Release 0.333.0

* Improve handling of query results containing `null` values for
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def assert_headers(headers):
assert headers[constants.HEADER_SESSION] == ""
assert headers[constants.HEADER_TRANSACTION] is None
assert headers[constants.HEADER_TIMEZONE] == timezone
assert headers[constants.HEADER_CLIENT_CAPABILITIES] == "PARAMETRIC_DATETIME,SESSION_AUTHORIZATION"
assert headers[constants.HEADER_CLIENT_CAPABILITIES] == constants.CLIENT_CAPABILITIES
assert headers[accept_encoding_header] == accept_encoding_value
assert headers[client_info_header] == client_info_value
assert headers[constants.HEADER_ROLE] == (
Expand Down
3 changes: 2 additions & 1 deletion trino/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ def http_headers(self) -> CaseInsensitiveDict[str]:
headers[constants.HEADER_ENCODING] = self._client_session.encoding
else:
raise ValueError("Invalid type for encoding: expected str or list")
headers[constants.HEADER_CLIENT_CAPABILITIES] = 'PARAMETRIC_DATETIME,SESSION_AUTHORIZATION'
headers[constants.HEADER_CLIENT_CAPABILITIES] = constants.CLIENT_CAPABILITIES

headers["user-agent"] = f"{constants.CLIENT_NAME}/{__version__}"
if len(self._client_session.roles.values()):
headers[constants.HEADER_ROLE] = ",".join(
Expand Down
3 changes: 3 additions & 0 deletions trino/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
HEADER_SET_CATALOG = "X-Trino-Set-Catalog"

HEADER_CLIENT_CAPABILITIES = "X-Trino-Client-Capabilities"
CLIENT_CAPABILITY_PARAMETRIC_DATETIME = "PARAMETRIC_DATETIME"
CLIENT_CAPABILITY_SESSION_AUTHORIZATION = "SESSION_AUTHORIZATION"
CLIENT_CAPABILITIES = ','.join([CLIENT_CAPABILITY_PARAMETRIC_DATETIME, CLIENT_CAPABILITY_SESSION_AUTHORIZATION])

HEADER_AUTHORIZATION_USER = "X-Trino-Authorization-User"
HEADER_SET_AUTHORIZATION_USER = "X-Trino-Set-Authorization-User"
Expand Down