Lee-W commented on code in PR #56298:
URL: https://github.com/apache/airflow/pull/56298#discussion_r2431794062
##########
providers/presto/src/airflow/providers/presto/hooks/presto.py:
##########
@@ -155,23 +155,38 @@ def sqlalchemy_url(self) -> URL:
"""Return a `sqlalchemy.engine.URL` object constructed from the
connection."""
conn = self.get_connection(self.get_conn_id())
extra = conn.extra_dejson or {}
- catalog = extra.get("catalog", "hive")
schema = conn.schema
- query = {"protocol": extra.get("protocol", "http"), "source":
extra.get("source", "airflow")}
+ if not conn.host:
+ raise AirflowException("Presto connection error: 'host' is missing
in the connection.")
+ if not conn.port:
+ raise AirflowException("Presto connection error: 'port' is missing
in connection.")
+ if not conn.login:
+ raise AirflowException("Presto connection error: 'login' is
missing in Connection")
Review Comment:
As menteiond in
https://github.com/apache/airflow/blob/ec42f30c9dd338655ac6c6f277f8c7d66c11d4f5/contributing-docs/05_pull_requests.rst#dont-raise-airflowexception-directly,
we decided to avoid `AirflowException` usage
--
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]