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 2021/11/05 08:22:38 UTC

[GitHub] [airflow] potiuk edited a comment on pull request #19419: Handle more patterns in `restrict-start_date` pre-commit hook

potiuk edited a comment on pull request #19419:
URL: https://github.com/apache/airflow/pull/19419#issuecomment-961705849


   Should we stop using regexp for that one?
   
    The old Chinese proverb says: "If you have a problem, introduce regexp - you will have two problems". This regexp will be impossible to reason about, fix and improve by anyone who will add a different pattern in the future.
   
   Why don't we ast.parse() the example Dags and walk the tree and find default_args  and start_date ? That sounds like 20 lines of python code that will handle REALLY all cases. (and it has a bonus - we will also validate that example dags are parseable Python files). 


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