◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,17 @@ def __init__(
catalog: Optional[str] = None,
auth: Optional[Any] = None,
http_scheme: Optional[str] = None,
):
self.host = host or os.getenv("TRINO_HOST")
self.port = port or os.getenv("TRINO_PORT")
self.user = user or os.getenv("TRINO_USER")
self.catalog = catalog or os.getenv("TRINO_CATALOG")
self.auth = auth or os.getenv("TRINO_AUTH")
self.http_scheme = http_scheme or os.getenv("TRINO_HTTP_SCHEME")
self._cursor: Optional[Cursor] = None

if self.host is None:
Expand All @@ -56,13 +60,20 @@ def __init__(

def _get_cursor(self) -> Cursor:
if self._cursor is None:
self._cursor = trino.dbapi.connect(
host=self.host,
port=self.port,
user=self.user,
catalog=self.catalog,
auth=self.auth,
http_scheme=self.http_scheme,
).cursor()

return self._cursor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ def get_table_column_names_and_types(
self, config: RepoConfig
) -> Iterable[Tuple[str, str]]:
client = Trino(
user="user",
catalog=config.offline_store.catalog,
host=config.offline_store.host,
port=config.offline_store.port,
Expand Down
Toggle all file notes Toggle all file annotations