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

[Feature] raise AirflowFailException in order to avoid retrying dbt test tasks on failure #1537

Open
1 task done
okayhooni opened this issue Feb 13, 2025 · 1 comment · May be fixed by #1563
Open
1 task done

[Feature] raise AirflowFailException in order to avoid retrying dbt test tasks on failure #1537

okayhooni opened this issue Feb 13, 2025 · 1 comment · May be fixed by #1563
Labels
dbt:test Primarily related to dbt test command or functionality enhancement New feature or request triage-needed Items need to be reviewed / assigned to milestone

Comments

@okayhooni
Copy link

Description

Currently, all dbt tasks generated by Cosmos may inherit the same retries setting through the default_args parameter. However, unlike dbt run tasks, it seems unreasonable for dbt test tasks to be retried upon failure.

If a data test fails, rerunning it will likely result in the same failure, making retries unnecessary and incurring additional time and resource costs.

To optimize execution, how about introducing a parameter like no_retries_on_test_failure: bool = True? When enabled, this would ensure that dbt test tasks raise an AirflowFailException instead of an AirflowException, preventing them from being retried while keeping the existing retry behavior for other dbt tasks.

Use case/motivation

To optimize execution, dbt test tasks should raise an AirflowFailException instead of an AirflowException when they fail. This will prevent them from being retried while keeping other dbt tasks, such as dbt run, unaffected.

Related issues

No response

Are you willing to submit a PR?

  • Yes, I am willing to submit a PR!
@okayhooni okayhooni added enhancement New feature or request triage-needed Items need to be reviewed / assigned to milestone labels Feb 13, 2025
@dosubot dosubot bot added the dbt:test Primarily related to dbt test command or functionality label Feb 13, 2025
@pankajkoti
Copy link
Contributor

@okayhooni nice report. no_retries_on_test_failure: bool = True sounds reasonable to me. Looking forward to your contribution :)

@okayhooni okayhooni linked a pull request Feb 25, 2025 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dbt:test Primarily related to dbt test command or functionality enhancement New feature or request triage-needed Items need to be reviewed / assigned to milestone
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants