Pyasma commented on code in PR #57153:
URL: https://github.com/apache/airflow/pull/57153#discussion_r2463280193
##########
providers/apache/impala/src/airflow/providers/apache/impala/hooks/impala.py:
##########
@@ -45,3 +46,30 @@ def get_conn(self) -> Connection:
database=connection.schema,
**connection.extra_dejson,
)
+
+ @property
+ 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 {}
+
+ required_attrs = ["host", "login"]
+ for attr in required_attrs:
+ if getattr(conn, attr) is None:
+ raise ValueError(f"Impala Connection Error: '{attr}' is
missing in the connection")
+
+ query = {k: str(v) for k, v in extra.items() if v is not None and k
not in ["__extra__"]}
Review Comment:
@KoviAnusha Hey, I looked into BaseDbApiHook.get_uri().
In Impala, the Extras field is required for configurations like Kerberos and
SSL, and I don’t think the base DB hook fully supports that.
If you have any references or examples showing how to integrate Extras with
the base method, I’d really appreciate it if you could share them.
--
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]