Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AIRFLOW-7022] Simplify DagFileProcessor.process_file method #7674

Merged
merged 8 commits into from
Mar 12, 2020
6 changes: 3 additions & 3 deletions airflow/jobs/scheduler_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,11 +845,11 @@ def process_file(

paused_dag_ids = DagModel.get_paused_dag_ids(dag_ids=dagbag.dag_ids)

active_dags = [dag for dag_id, dag in dagbag.dags.items() if dag_id not in paused_dag_ids]
unpaaused_dags = [dag for dag_id, dag in dagbag.dags.items() if dag_id not in paused_dag_ids]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
unpaaused_dags = [dag for dag_id, dag in dagbag.dags.items() if dag_id not in paused_dag_ids]
unpaused_dags = [dag for dag_id, dag in dagbag.dags.items() if dag_id not in paused_dag_ids]


simple_dags = self._prepare_simple_dags(active_dags, pickle_dags, session)
simple_dags = self._prepare_simple_dags(unpaaused_dags, pickle_dags, session)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
simple_dags = self._prepare_simple_dags(unpaaused_dags, pickle_dags, session)
simple_dags = self._prepare_simple_dags(unpaused_dags, pickle_dags, session)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks.


dags = self._find_dags_to_process(active_dags)
dags = self._find_dags_to_process(unpaaused_dags)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dags = self._find_dags_to_process(unpaaused_dags)
dags = self._find_dags_to_process(unpaused_dags)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks.


ti_keys_to_schedule = self._process_dags(dags, session)

Expand Down
2 changes: 1 addition & 1 deletion tests/jobs/test_scheduler_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ def test_process_file_should_failure_callback(self):
self.assertEqual("Callback fired", content)
os.remove(callback_file.name)

def test_should_parse_only_active_dags(self):
def test_should_parse_only_unpaused_dags(self):
dag_file = os.path.join(
os.path.dirname(os.path.realpath(__file__)), '../dags/test_multiple_dags.py'
)
Expand Down