jason810496 commented on code in PR #48917:
URL: https://github.com/apache/airflow/pull/48917#discussion_r2037783882
##########
providers/trino/src/airflow/providers/trino/hooks/trino.py:
##########
@@ -322,3 +323,38 @@ def get_openlineage_database_dialect(self, _):
def get_openlineage_default_schema(self):
"""Return Trino default schema."""
return trino.constants.DEFAULT_SCHEMA
+
+ def get_uri(self) -> str:
+ """Return the Trino URI for the connection."""
+ conn = self.connection
+ uri = "trino://"
+
+ auth_part = ""
+ if conn.login:
+ auth_part = quote_plus(conn.login)
+ if conn.password:
+ auth_part = f"{auth_part}:{quote_plus(conn.password)}"
+ auth_part = f"{auth_part}@"
+
+ host_part = conn.host or "localhost"
+ if conn.port:
+ host_part = f"{host_part}:{conn.port}"
+
+ schema_part = ""
+ if conn.schema:
+ schema_part = f"/{quote_plus(conn.schema)}"
+ extra_schema = conn.extra_dejson.get("schema")
+ if extra_schema:
+ schema_part = f"{schema_part}/{quote_plus(extra_schema)}"
Review Comment:
I tried removing the overridden `get_uri` here and found that **schema is a
special case** for Trino compared to the `conn.get_uri` implementation.
If that's the case, then yes—we still need to override the `get_uri`
implementation. Sorry for overlooking this part.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]