kenjihiraoka commented on a change in pull request #9943:
URL: https://github.com/apache/airflow/pull/9943#discussion_r459406912



##########
File path: airflow/providers/postgres/hooks/postgres.py
##########
@@ -58,7 +59,9 @@ def __init__(self, *args, **kwargs):
         self.connection = kwargs.pop("connection", None)
         self.conn = None
 
-    def _get_cursor(self, raw_cursor):
+    def _get_cursor(self, raw_cursor: str) -> Union[psycopg2.extras.DictCursor,
+                                                    
psycopg2.extras.RealDictCursor,
+                                                    
psycopg2.extras.NamedTupleCursor]:

Review comment:
       Is it gonna be something like this:
   
   ```
       conn_name_attr = 'postgres_conn_id'
       default_conn_name = 'postgres_default'
       supports_autocommit = True
       return_cursor_type = Union[psycopg2.extras.DictCursor, 
                                  psycopg2.extras.RealDictCursor, 
                                  psycopg2.extras.NamedTupleCursor]
       def __init__():
       
       def _get_cursor(self, raw_cursor: str) -> return_cursor_type:
   ```
   Does it make sense?




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to