feluelle commented on code in PR #26744:
URL: https://github.com/apache/airflow/pull/26744#discussion_r984584554


##########
airflow/providers/postgres/hooks/postgres.py:
##########
@@ -67,10 +68,18 @@ class PostgresHook(DbApiHook):
     supports_autocommit = True
 
     def __init__(self, *args, **kwargs) -> None:
+        if 'schema' in kwargs:
+            warnings.warn(
+                'The "schema" arg has been renamed to "database" as it 
contained the database name.'
+                'Please use "database" to set the database name.',
+                DeprecationWarning,
+                stacklevel=2,
+            )
+            kwargs['database'] = kwargs['schema']
         super().__init__(*args, **kwargs)
         self.connection: Connection | None = kwargs.pop("connection", None)
         self.conn: connection = None
-        self.schema: str | None = kwargs.pop("schema", None)
+        self.database: str | None = kwargs.pop("database", None)

Review Comment:
   Okay, will add it.



-- 
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]

Reply via email to