Skip to content
Open
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
1 change: 1 addition & 0 deletions tests/unit/test_dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ def test_description_is_none_when_cursor_is_not_executed():
("http://mytrinoserver.domain:9999", None, None, constants.HTTP),
# Infer from port
("mytrinoserver.domain", constants.DEFAULT_TLS_PORT, None, constants.HTTPS),
("mytrinoserver.domain", constants.SECONDARY_TLS_PORT, None, constants.HTTPS),
("mytrinoserver.domain", constants.DEFAULT_PORT, None, constants.HTTP),
# http_scheme parameter has higher precedence than port parameter
("mytrinoserver.domain", constants.DEFAULT_TLS_PORT, constants.HTTP, constants.HTTP),
Expand Down
1 change: 1 addition & 0 deletions trino/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

DEFAULT_PORT = 8080
DEFAULT_TLS_PORT = 443
SECONDARY_TLS_PORT = 8443
DEFAULT_SOURCE = "trino-python-client"
DEFAULT_CATALOG: Optional[str] = None
DEFAULT_SCHEMA: Optional[str] = None
Expand Down
2 changes: 1 addition & 1 deletion trino/dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def __init__(
self.http_scheme = parsed_host.scheme
elif http_scheme:
self.http_scheme = http_scheme
elif port == constants.DEFAULT_TLS_PORT:
elif port in (constants.DEFAULT_TLS_PORT, constants.SECONDARY_TLS_PORT):
self.http_scheme = constants.HTTPS
elif port == constants.DEFAULT_PORT:
self.http_scheme = constants.HTTP
Expand Down