Lee-W commented on code in PR #56305:
URL: https://github.com/apache/airflow/pull/56305#discussion_r2404379581
##########
providers/teradata/src/airflow/providers/teradata/hooks/teradata.py:
##########
@@ -34,6 +34,7 @@
except ImportError:
from airflow.models.connection import Connection # type:
ignore[assignment]
+DEFAULT_DB_PORT = 1025
Review Comment:
nit: Probably could add a link to the doc that mentions 1025 as a comment
above this line.
##########
providers/teradata/src/airflow/providers/teradata/hooks/teradata.py:
##########
@@ -195,12 +196,32 @@ def _get_conn_config_teradatasql(self) -> dict[str, Any]:
return conn_config
- def get_sqlalchemy_engine(self, engine_kwargs=None):
Review Comment:
This is technically a breaking change. @eladkal do we need to do anything?
##########
providers/teradata/src/airflow/providers/teradata/hooks/teradata.py:
##########
@@ -195,12 +196,32 @@ def _get_conn_config_teradatasql(self) -> dict[str, Any]:
return conn_config
- def get_sqlalchemy_engine(self, engine_kwargs=None):
- """Return a connection object using sqlalchemy."""
- conn: Connection = self.get_connection(self.get_conn_id())
- link = f"teradatasql://{conn.login}:{conn.password}@{conn.host}"
- connection = sqlalchemy.create_engine(link)
- return connection
+ @property
+ def sqlalchemy_url(self) -> URL:
+ """
+ Override to return a Sqlalchemy.engine.URL object from the Teradata
connection.
Review Comment:
I'm a bit confused. override what to return the object?
##########
providers/teradata/src/airflow/providers/teradata/hooks/teradata.py:
##########
@@ -195,12 +196,32 @@ def _get_conn_config_teradatasql(self) -> dict[str, Any]:
return conn_config
- def get_sqlalchemy_engine(self, engine_kwargs=None):
- """Return a connection object using sqlalchemy."""
- conn: Connection = self.get_connection(self.get_conn_id())
- link = f"teradatasql://{conn.login}:{conn.password}@{conn.host}"
- connection = sqlalchemy.create_engine(link)
- return connection
+ @property
+ def sqlalchemy_url(self) -> URL:
+ """
+ Override to return a Sqlalchemy.engine.URL object from the Teradata
connection.
Review Comment:
```suggestion
Override to return a `sqlalchemy.engine.URL` object from the
Teradata connection.
```
--
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]