shahar1 commented on code in PR #41009:
URL: https://github.com/apache/airflow/pull/41009#discussion_r1692045442
##########
airflow/providers/google/cloud/hooks/cloud_sql.py:
##########
@@ -1140,22 +1138,28 @@ def get_sqlproxy_runner(self) -> CloudSqlProxyRunner:
gcp_conn_id=self.gcp_conn_id,
)
- def get_database_hook(self, connection: Connection) -> PostgresHook |
MySqlHook:
+ def get_database_hook(self, connection: Connection) -> BaseHook:
"""
Retrieve database hook.
This is the actual Postgres or MySQL database hook that uses proxy or
connects directly to the Google Cloud SQL database.
"""
if self.database_type == "postgres":
- db_hook: PostgresHook | MySqlHook =
PostgresHook(connection=connection, database=self.database)
+ from airflow.providers.postgres.hooks.postgres import PostgresHook
+
+ db_hook: BaseHook = PostgresHook(connection=connection,
database=self.database)
Review Comment:
Do you get a mypy error without `: BaseHook`?
--
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]