darwinyip commented on pull request #9887: URL: https://github.com/apache/airflow/pull/9887#issuecomment-661438359
For the following mypy errors: ``` providers/imap/hooks/imap.py:69: error: Incompatible types in assignment (expression has type "IMAP4_SSL", variable has type "None") providers/imap/hooks/imap.py:70: error: "None" has no attribute "login" providers/imap/hooks/imap.py:202: error: "None" has no attribute "select" providers/imap/hooks/imap.py:214: error: "None" has no attribute "close" providers/imap/hooks/imap.py:219: error: "None" has no attribute "search" providers/imap/hooks/imap.py:224: error: "None" has no attribute "fetch" ``` It seems related to https://github.com/apache/airflow/blob/master/airflow/providers/imap/hooks/imap.py#L66-L69 which I found this issue https://github.com/python/mypy/issues/4520 I recommend adding `--strict-optional` flag. ---------------------------------------------------------------- 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]
