You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/08/04 21:02:48 UTC

[GitHub] [airflow] jedcunningham commented on a change in pull request #17423: Make schema in DBApiHook private

jedcunningham commented on a change in pull request #17423:
URL: https://github.com/apache/airflow/pull/17423#discussion_r682957637



##########
File path: airflow/providers/postgres/hooks/postgres.py
##########
@@ -70,6 +70,7 @@ def __init__(self, *args, **kwargs) -> None:
         super().__init__(*args, **kwargs)
         self.connection: Optional[Connection] = kwargs.pop("connection", None)
         self.conn: connection = None
+        self.schema: Optional[str] = kwargs.pop("schema", None)

Review comment:
       Instead, maybe this:
   ```suggestion
           if not hasattr(self, "schema"):
               self.schema: Optional[str] = kwargs.pop("schema", None)
   ```
   
   That should work for core both pre and post 2.2.0 and wouldn't break behavior of `get_uri` either like doing `__schema` does.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org