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

Issue with output of print_dbt_project_evaluator_issues #398

Closed
1 of 6 tasks
nsoria1 opened this issue Dec 1, 2023 · 9 comments
Closed
1 of 6 tasks

Issue with output of print_dbt_project_evaluator_issues #398

nsoria1 opened this issue Dec 1, 2023 · 9 comments
Labels
bug Something isn't working Stale

Comments

@nsoria1
Copy link

nsoria1 commented Dec 1, 2023

Describe the bug

Following these instructions, I used the macro print_dbt_project_evaluator_issues in the property on-run-end. At the end of running dbt_project_evaluator, I get nothing.

on-run-end: "{{ dbt_project_evaluator.print_dbt_project_evaluator_issues() }}"

Steps to reproduce

My dbt_project.yml looks something like this:

config-version: 2

model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]

vars:
  exclude_paths_from_project: ["/stg_media_status_events.sql", "/stg_user_accounts.sql"]

models:
  dbt_project_evaluator:
    marts:
      structure:
        fct_model_naming_conventions: 
          +enabled: false
        fct_source_directories:
          +enabled: false
        fct_model_directories:
          +enabled: false
      dag:
        fct_staging_dependent_on_staging:
          +enabled: false
        fct_rejoining_of_upstream_concepts:
          +enabled: false

on-run-end: "{{ dbt_project_evaluator.print_dbt_project_evaluator_issues() }}" Run the command:

dbt build package:dbt_project_evaluator

Expected results

I expect dbt_project_evaluator to show up information about the warn steps highlighted in the command.

Screenshots and log output

01:03:48 Finished running 23 table models, 1 seed, 15 view models, 22 tests, 2 hooks in 0 hours 0 minutes and 33.90 seconds (33.90s).
01:03:48 Completed with 2 warnings:
01:03:48 Warning in test valid_test_coverage (models/marts/tests/testing.yml)
01:03:48 Got 1 result, configured to warn if != 0
01:03:48   compiled Code at /app/dbt_project/__local_target/compiled/dbt_project_evaluator/models/marts/tests/testing.yml/valid_test_coverage.sql
01:03:48 Warning in test is_empty_fct_missing_primary_key_tests_ (models/marts/tests/testing.yml)
01:03:48 Got 1 result, configured to warn if != 0
01:03:48   compiled Code at /app/dbt_project/__local_target/compiled/dbt_project_evaluator/models/marts/tests/testing.yml/is_empty_fct_missing_primary_key_tests_.sql
01:03:48 Done. PASS=59 WARN=2 ERROR=0 SKIP=0 TOTAL=61

System information

packages:
  - package: dbt-labs/dbt_utils
    version: 1.1.1
  - package: dbt-labs/dbt_project_evaluator
    version: 0.8.0

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • trino/starburst
  • other (specify: ____________)

The output of dbt --version:

dbt Cloud CLI - 0.34.16 (b16ec451ab12948f2c88d41fa851928511a99d43 2023-11-28T18:04:22Z)

Additional context

Are you interested in contributing the fix?

@nsoria1 nsoria1 added the bug Something isn't working label Dec 1, 2023
@b-per
Copy link
Collaborator

b-per commented Dec 4, 2023

Thanks for raising this! This is due to the fact that the print() function behaves differently in dbt Core and dbt Cloud. I am checking with the team if there is a way to update the print() behaviour.

I will keep it open for now and will think of a long term solution.

@nsoria1
Copy link
Author

nsoria1 commented Dec 4, 2023

@b-per thanks for the reply! On dbt Cloud should behave correctly? I haven't tested there.

@b-per
Copy link
Collaborator

b-per commented Dec 4, 2023

I don't think that dbt Cloud IDE will show the print() results either. I don't know about the dbt Cloud jobs.

@sn-nsoria
Copy link

@b-per is there any way to identify the detected resources to simplify the next steps? Otherwise we need to go file by file

@b-per
Copy link
Collaborator

b-per commented Dec 11, 2023

Hi @sn-nsoria

What do you mean here?

@sn-nsoria
Copy link

Hi @b-per - thanks for replying. I mean, when I got a warn alert for example for some of the rules, how can I identify which models / tables / objects are not following the rule so we can go and fix it? Thanks

@b-per
Copy link
Collaborator

b-per commented Dec 11, 2023

Most of the tests (if not all), should start with is_empty_fct_abcd.

To see the failing records, you can:

  • use print_dbt_project_evaluator_issues (which it seems does not work in the IDE and the Cloud CLI) but might work for jobs in dbt Cloud
  • or directly query the table fct_abcd that has been created in the warehouse

Copy link
Contributor

github-actions bot commented Jun 9, 2024

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 label Jun 9, 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 Jun 16, 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 Stale
Projects
None yet
Development

No branches or pull requests

3 participants