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

Fix entire DAG stops when one task has end_date #20920

Merged
merged 1 commit into from Mar 27, 2022
Merged

Fix entire DAG stops when one task has end_date #20920

merged 1 commit into from Mar 27, 2022

Conversation

chenglongyan
Copy link
Contributor

@chenglongyan chenglongyan commented Jan 18, 2022

Closes: #19917 , #20471

@uranusjr
Copy link
Member

Please revert all the whitespace changes. They make static checks fail, and it’s extremely difficult to review what you actually want to change due to all the noise.

@eladkal eladkal added this to the Airflow 2.2.4 milestone Jan 24, 2022
@potiuk potiuk closed this Feb 6, 2022
@potiuk potiuk reopened this Feb 6, 2022
Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

I looks good to me but requires another commiter approval. Also it needs additional test covering the scenario, to avoid regressions in the future.

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

Need another commiter approval.

@github-actions
Copy link

github-actions bot commented Mar 7, 2022

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Mar 7, 2022
@ephraimbuddy
Copy link
Contributor

@chenglongyan please rebase

@chenglongyan
Copy link
Contributor Author

I'm sorry, I've been too busy lately, I'll follow up in time

@ephraimbuddy ephraimbuddy removed this from the Airflow 2.2.5 milestone Mar 22, 2022
@chenglongyan
Copy link
Contributor Author

@ephraimbuddy

Comment on lines 799 to 804
def task_filter(task: "Operator") -> bool:
return task.task_id not in task_ids and (
self.is_backfill or task.start_date <= self.execution_date
self.is_backfill
or task.start_date <= self.execution_date
and (task.end_date is None or self.execution_date <= task.end_date)
)
Copy link
Member

@uranusjr uranusjr Mar 25, 2022

Choose a reason for hiding this comment

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

Let’s refactor this to early returns to improve readability, something like

def task_filter(task: "Operator") -> bool:
    if task.task_id in task_ids:
        return False
    if self.is_backfill:
        return ...
    ...
    return ...

@potiuk potiuk merged commit 85871eb into apache:main Mar 27, 2022
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full tests needed We need to run full set of tests for this PR to merge type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Task-level end_date stops entire DAG
6 participants