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] Changes under data_tests: top-level key within properties.yml files not seen by partial parsing #10801

Open
2 tasks done
dbeatty10 opened this issue Sep 30, 2024 · 0 comments
Labels
bug Something isn't working partial_parsing pre-release Bug not yet in a stable release

Comments

@dbeatty10
Copy link
Contributor

dbeatty10 commented Sep 30, 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

With the change in #10792, any changes to the data_tests: within _properties.yml / schema.yml (patch) files are not picked up by partial parsing, and the --no-partial-parse flag is necessary to pick them up.

Expected Behavior

I expected that I could change the content within data_tests:, and dbt would see those changes, even when using partial parsing.

Steps To Reproduce

See dbt-labs/docs.getdbt.com#6132 (comment) for an example of how to use the data_tests: top-level key.

Specifically:

data_tests:
  - name: my_singular_test
    description: Some docs

versus:

data_tests:
  - name: my_singular_test
    description: Some docs
    config:
      error_if: ">10"
    meta:
      some_key: some_val

Relevant log output

Note that this is a FAIL because changes within the data_tests: top-level key were not picked up:

partial success

$ dbt test -s my_project.my_singular_test

20:08:55  Running with dbt=1.9.0-a1
20:08:55  Registered adapter: postgres=1.9.0-a1
20:08:56  Found 1 test, 423 macros
20:08:56  
20:08:56  Concurrency: 5 threads (target='postgres')
20:08:56  
20:08:57  1 of 1 START test my_singular_test ............................................. [RUN]
20:08:57  1 of 1 FAIL 2 my_singular_test ................................................. [FAIL 2 in 0.06s]
20:08:57  
20:08:57  Finished running 1 test in 0 hours 0 minutes and 1.08 seconds (1.08s).
20:08:57  
20:08:57  Completed with 1 error, 0 partial successs, and 0 warnings:
20:08:57  
20:08:57  Failure in test my_singular_test (tests/my_singular_test.sql)
20:08:57    Got 2 results, configured to fail if != 0
20:08:57  
20:08:57    compiled code at target/compiled/my_project/tests/my_singular_test.sql
20:08:57  
20:08:57  Done. PASS=0 WARN=0 ERROR=1 SKIP=0 TOTAL=1

But this is a WARN because changes within the data_tests: top-level key were picked up by disabling partial parsing:

$ dbt test -s my_project.my_singular_test --no-partial-parse

20:09:05  Running with dbt=1.9.0-a1
20:09:05  Registered adapter: postgres=1.9.0-a1
20:09:07  Found 1 test, 423 macros
20:09:07  
20:09:07  Concurrency: 5 threads (target='postgres')
20:09:07  
20:09:07  1 of 1 START test my_singular_test ............................................. [RUN]
20:09:07  1 of 1 WARN 2 my_singular_test ................................................. [WARN 2 in 0.08s]
20:09:07  
20:09:07  Finished running 1 test in 0 hours 0 minutes and 0.31 seconds (0.31s).
20:09:07  
20:09:07  Completed with 1 warning:
20:09:07  
20:09:07  Warning in test my_singular_test (tests/my_singular_test.sql)
20:09:07  Got 2 results, configured to warn if != 0
20:09:07  
20:09:07    compiled code at target/compiled/my_project/tests/my_singular_test.sql
20:09:07  
20:09:07  Done. PASS=0 WARN=1 ERROR=0 SKIP=0 TOTAL=1

Environment

- OS:
- Python:
- dbt:

Which database adapter are you using with dbt?

No response

Additional Context

No response

@dbeatty10 dbeatty10 added bug Something isn't working triage partial_parsing pre-release Bug not yet in a stable release and removed triage labels Sep 30, 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 partial_parsing pre-release Bug not yet in a stable release
Projects
None yet
Development

No branches or pull requests

1 participant