trinodb / trino-python-client

Python client for Trino
Apache License 2.0
309 stars 151 forks source link

Checking for config headers to be both present and non-empty #263

Closed derek-pyne closed 1 year ago

derek-pyne commented 1 year ago

Addresses #262 .

Handles cases where these config headers are present in the request, but with an empty string as their value. Currently, an error is raised when trying to parse the empty strings. This PR addresses this by checking that these headers are not only present, but not empty.

These headers being present with empty values is not normally expected, although we'd like to protect against it for cases like a proxy sitting in between Trino and the client that is altering the headers (which is the case for me).

Notes:

Non-technical explanation

Protecting against headers being present but without data

Release notes

( ) This is not user-visible or docs only and no release notes are required. ( ) Release notes are required, please propose a release note for me. (x) Release notes are required, with the following suggested text:

* Fix value error with present but empty headers. ([#262](https://github.com/trinodb/trino-python-client/issues/262))
cla-bot[bot] commented 1 year ago

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

cla-bot[bot] commented 1 year ago

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to cla@trino.io. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

derek-pyne commented 1 year ago

Morning! Just checking in if this is a change we'd like to include, or something we want to discuss more :)

hashhar commented 1 year ago

@derek-pyne I've been travelling so did not get a chance to re-review/merge. I'll get to this starting the weekend/Monday.

Sorry about the long wait.

hashhar commented 1 year ago

@cla-bot check

cla-bot[bot] commented 1 year ago

The cla-bot has been summoned, and re-checked this pull request!

derek-pyne commented 1 year ago

@derek-pyne I've been travelling so did not get a chance to re-review/merge. I'll get to this starting the weekend/Monday.

Sorry about the long wait.

All good! No rush, just checking in

hashhar commented 1 year ago

Squashed the commits. Will merge once CI is done. Thanks for the fix.