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] Prevent Scheduling of Multi-Parent Data Tests in Two DAGs #1485

Open
1 task done
Magicbeanbuyer opened this issue Jan 23, 2025 · 1 comment
Open
1 task done
Assignees
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

@Magicbeanbuyer
Copy link

Description

Currently, when a data test in dbt compares two models from different DAGs using the compare_model configuration, cosmos package schedules two tests, one for each model in each DAG. If an error occurs during the test, both tests will fail. This behavior can lead to unintended DAG failures and may not align with the user's expectations.

The behaviour can be reproduced by this repository. Note that setting should_detach_multiple_parents_tests to True does not solve this issue, when the two Models are in two different DAGs.

I would propose instead of creating a test in both DAGs, the feature would ensure that the test is only scheduled in the DAG where it is defined.

This change would improve the reliability of the data testing process and align more closely with user expectations. It would also simplify the process of managing and resolving test failures, as the responsibility would clearly lie with the owner of the DAG where the test is defined.

The implementation would likely involve changes to modify the logic around how tests with the compare_model configuration are scheduled.

Use case/motivation

No response

Related issues

No response

Are you willing to submit a PR?

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

tatiana commented Jan 28, 2025

Hi, @Magicbeanbuyer, this looks like a significant improvement. Thank you for creating the issue! Since you're willing to contribute, I'm adding you as an assignee. Please, let us know if you'd like any support.

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

No branches or pull requests

2 participants