Lee-W commented on code in PR #55928:
URL: https://github.com/apache/airflow/pull/55928#discussion_r2366192239
##########
providers/vertica/src/airflow/providers/vertica/hooks/vertica.py:
##########
@@ -134,6 +134,33 @@ def get_conn(self) -> connect:
conn = connect(**conn_config)
return conn
+ @property
+ def sqlalchemy_url(self):
+ """Return a SQLAlchemy URL object with properly formatted query
parameters."""
+ conn = self.get_connection(self.get_conn_id())
+ extra = conn.extra_dejson or {}
+
+ # Normalize query dictionary
+ query = {
+ k: ([str(x) for x in v] if isinstance(v, (list, tuple)) else
str(v))
+ for k, v in extra.items()
+ if v is not None
+ }
+
+ return URL.create(
+ drivername="vertica-python",
+ username=conn.login,
+ password=conn.password or "",
+ host=conn.host or "localhost",
+ port=conn.port or 5433,
+ database=conn.schema,
+ query=query,
+ )
+
+ def get_uri(self):
Review Comment:
let's add a type annotation here. I assume it's a str?
```suggestion
def get_uri(self) -> str:
```
##########
providers/vertica/src/airflow/providers/vertica/hooks/vertica.py:
##########
@@ -134,6 +134,33 @@ def get_conn(self) -> connect:
conn = connect(**conn_config)
return conn
+ @property
+ def sqlalchemy_url(self):
Review Comment:
same here
--
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]