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 2022/01/04 16:22:07 UTC

[GitHub] [airflow] kazanzhy commented on a change in pull request #20651: Fix mypy in providers/grpc and providers/imap

kazanzhy commented on a change in pull request #20651:
URL: https://github.com/apache/airflow/pull/20651#discussion_r778212808



##########
File path: airflow/providers/imap/hooks/imap.py
##########
@@ -71,7 +71,7 @@ def get_conn(self) -> 'ImapHook':
         """
         if not self.mail_client:
             conn = self.get_connection(self.imap_conn_id)
-            self.mail_client = imaplib.IMAP4_SSL(conn.host, conn.port or imaplib.IMAP4_SSL_PORT)
+            self.mail_client = imaplib.IMAP4_SSL(conn.host, conn.port or imaplib.IMAP4_SSL.port)

Review comment:
       I think this solution might be not correct.
   There is no class attribute for `IMAP4_SSL`, and `self.port` is defined in method `open`.
   See how I decided to resolve this issue
   https://github.com/apache/airflow/pull/20654/files#diff-b986a5d7078309e7eaad82d9b534ead3b21f0f884c927fdd21674cd4390a935a




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