trinodb / trino-python-client

Python client for Trino
Apache License 2.0
307 stars 150 forks source link

Default to https scheme when port is 443 (sqlalchemy) #421

Closed alexfricker closed 7 months ago

alexfricker commented 8 months ago

Description

Attempting to use sqlalchemy with HTTPS scheme and default port 443 results in a TrinoConnectionError: RemoteDisconnected('Remote end closed connection without response') as the underlying dialect's http_scheme is set to http not https. This PR will automatically set the http_scheme to https which alleviates the connection issue.

Trino server: 430 Trino client: 0.327.0 SQLAlchemy: 2.0.22

Non-technical explanation

Using sqlalchemy with a Trino server accessed via an https endpoint and no custom port results in a connection error.

Release notes

(x) 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. ( ) Release notes are required, with the following suggested text:

* Fix some things. ({issue}`issuenumber`)
cla-bot[bot] commented 8 months 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