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

[Bug] Disabled generic tests appear in manifest.nodes #10299

Closed
2 tasks done
emmyoop opened this issue Jun 12, 2024 · 3 comments
Closed
2 tasks done

[Bug] Disabled generic tests appear in manifest.nodes #10299

emmyoop opened this issue Jun 12, 2024 · 3 comments
Labels
bug Something isn't working dbt tests Issues related to built-in dbt testing functionality Impact: CA stale Issues that have gone stale

Comments

@emmyoop
Copy link
Member

emmyoop commented Jun 12, 2024

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

When you have a generic test for a model, it remains in the manifest when disabled. Other node types are only in the disabled dictionary.

Expected Behavior

  • The generic test is not in in manifest.nodes
  • The generic test is in the disabled dict

Steps To Reproduce

my_model.sql

select 1 as id, 'orange' as color, false as is_primary_color

schema.yml

models:
  - name: column_removed_model
    columns:
      - name: id
        tests:
          - unique
  1. dbt compile and see the model and the test in manifest.nodes, disabled dictionary is empty
  2. delete my_model.sql
  3. dbt compile and see the test in manifest.nodes but not disabled dictionary
    or
  4. dbt compile and see the model and the test in manifest.nodes, disabled dictionary is empty
  5. add the enabled: false config my_model
  6. dbt compile and see the test in manifest.nodes but not disabled dictionary and the model in the disabled dict but not in manifest.nodes

Relevant log output

none

Environment

- dbt: 1.9a1

Which database adapter are you using with dbt?

No response

Additional Context

TODO: Does this also apply to singular tests?

This may require some tests that verify the number of nodes in the results equals a specific number. This is an unknown that may add some time to the fix.

More context for how it works now:
In compilation.py we specifically check for disabled tests in the "nodes" dictionary. However, when we do "cleanup_disabled" anything that's disabled ought to be moved to the disabled dictionary.

@emmyoop emmyoop added bug Something isn't working triage labels Jun 12, 2024
@dbeatty10 dbeatty10 added dbt tests Issues related to built-in dbt testing functionality and removed triage labels Jun 12, 2024
@gshank
Copy link
Contributor

gshank commented Jun 18, 2024

Tests for a disabled model aren't explicitly marked as disabled are they? We move everything in the "nodes" dictionary that's marked disabled into the "disabled" dictionary as a post-parsing step.

Copy link
Contributor

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

@github-actions github-actions bot added the stale Issues that have gone stale label Dec 16, 2024
Copy link
Contributor

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dbt tests Issues related to built-in dbt testing functionality Impact: CA stale Issues that have gone stale
Projects
None yet
Development

No branches or pull requests

4 participants