Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[AIRFLOW-3237] Refactor example DAGs #4071
Make sure you have checked all steps below.
I think it's important to have the example DAGs reflect good programming standards and how to write clean and concise Airflow code. Therefore, refactor the example DAGs, which mostly involves:
Only refactored some code, all existing tests should pass.
No new functionality.
Sorry, github is wonky for me today. First it wouldn't let me post comments and then it ended up with many duplicates and when I tried to clean them up it deleted all of them.
I previously wrote:
To which @BasPH replied...
I think the airflow team should decide on a preference for the community. One of the reasons that it is not used by everyone is probably because not everyone is aware of this feature. One of the reasons for that is that the examples are not using it :)
Personally I think the with statement is awesome, makes the DAG code much cleaner and reduces repetition.
I'd suggest adding a comment to the examples like...
I also think the clode is clearer when the DAG is initiated separately and not inside the with statement.
@@ Coverage Diff @@ ## master #4071 +/- ## ========================================== + Coverage 77.95% 78.71% +0.76% ========================================== Files 199 199 Lines 15974 17086 +1112 ========================================== + Hits 12452 13450 +998 - Misses 3522 3636 +114