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 2019/08/14 00:47:23 UTC

[GitHub] [airflow] houqp commented on a change in pull request #5664: [AIRFLOW-5140] fix all missing type annotation errors from dmypy

houqp commented on a change in pull request #5664: [AIRFLOW-5140] fix all missing type annotation errors from dmypy
URL: https://github.com/apache/airflow/pull/5664#discussion_r313668084
 
 

 ##########
 File path: airflow/settings.py
 ##########
 @@ -63,13 +67,13 @@
 LOG_FORMAT = conf.get('core', 'log_format')
 SIMPLE_LOG_FORMAT = conf.get('core', 'simple_log_format')
 
-SQL_ALCHEMY_CONN = None
-DAGS_FOLDER = None
-PLUGINS_FOLDER = None
-LOGGING_CLASS_PATH = None
+SQL_ALCHEMY_CONN = None  # type: Optional[str]
+DAGS_FOLDER = None  # type: Optional[str]
+PLUGINS_FOLDER = None  # type: Optional[str]
 
 Review comment:
   mypy only enforces type check statically, this means any change that happens at runtime will not be visible to it. Given these globals (and hook in `test_gcp_cloud_build_hook`) are actually populated after the python interpreter starts running, the optional is required.
   
   The optional type hint is basically added for this specific use case: this variable will be initialized as None, but will be changed at runtime.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services