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/06/01 10:12:42 UTC

[GitHub] [airflow] BasPH commented on a change in pull request #5355: [AIRFLOW-4720] Allow comments in .airflowignore files.

BasPH commented on a change in pull request #5355: [AIRFLOW-4720] Allow comments in .airflowignore files.
URL: https://github.com/apache/airflow/pull/5355#discussion_r289600026
 
 

 ##########
 File path: airflow/utils/dag_processing.py
 ##########
 @@ -315,7 +318,8 @@ def list_py_file_paths(directory, safe_mode=True,
                 with open(ignore_file, 'r') as f:
                     # If we have new patterns create a copy so we don't change
                     # the previous list (which would affect other subdirs)
-                    patterns += [re.compile(p) for p in f.read().split('\n') if p]
+                    lines = [COMMENT_PATTERN.sub("", line) for line in f.read().split("\n")]
 
 Review comment:
   LGTM. One small nit: the variable name `lines` doesn't really show the intention IMO. How about renaming it to e.g. "`lines_no_comments`"?

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