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

Warns are not summarized at the end of dbt test #1597

Closed
MartinGuindon opened this issue Jul 10, 2019 · 8 comments
Closed

Warns are not summarized at the end of dbt test #1597

MartinGuindon opened this issue Jul 10, 2019 · 8 comments
Labels
enhancement New feature or request good_first_issue Straightforward + self-contained changes, good for new contributors!
Milestone

Comments

@MartinGuindon
Copy link

MartinGuindon commented Jul 10, 2019

Issue

When using the new warn severity for tests, any warn results are not summarized at the end of the dbt test output, hence they could be easy to miss in larger projects.

Results

The current ouput looks like everything is fine and dandy, even if there are warnings:

15:23:56 | Finished running 282 tests in 19.27s.

Completed successfully

Done. PASS=282 ERROR=0 SKIP=0 TOTAL=282

I would instead expect an output similars to errors, summarizing how many warnings there are and which test(s) are returning warnings:

Completed successfully with 1 warnings:

Warning in test employees_overlapping_dates (tests/employees_overlapping_dates.sql)
  Got 23 results, expected 0.

  compiled SQL at target/compiled/absobi_dbt_operations/data_test/employees_overlapping_dates.sql

Done. PASS=281 ERROR=0 WARN=1 SKIP=0 TOTAL=282
@drewbanin drewbanin added this to the 0.14.1 milestone Jul 11, 2019
@drewbanin drewbanin added the enhancement New feature or request label Jul 11, 2019
@drewbanin
Copy link
Contributor

Thanks @MartinGuindon - really good idea! Would love to add this for the 0.14.0 bugfix/patch release

@drewbanin drewbanin added the good_first_issue Straightforward + self-contained changes, good for new contributors! label Jul 11, 2019
@emilieschario
Copy link
Contributor

Digging into this a bit, here is what I'm finding:

From looking at the run task, it should trickle through if that is the update.
https:/fishtown-analytics/dbt/blob/399b33822a85493a8790df787eed59e951aecf6c/core/dbt/task/run.py#L14

I will have to dig deeper into how the results are parsed for errors to see how/if warns needs to be different

Am I thinking about this the right way?

@beckjake
Copy link
Contributor

This is the key method: https:/fishtown-analytics/dbt/blob/399b33822a85493a8790df787eed59e951aecf6c/core/dbt/ui/printer.py#L266

I think what I would do is:

  • change TestRunner.after_execute() here to call a new function you make in dbt.ui.printer
  • have that new function be a lot like the current print_run_end_messages, except have it call a new function instead of print_run_status_line (print_test_status_line?)
  • have print_test_status_line handle the warn results accordingly

@emilieschario
Copy link
Contributor

Got it! Thanks for that additional color @beckjake. Could you assign this to me to indicate it's being worked on? I'd like to take a stab at it.

@drewbanin
Copy link
Contributor

Hey @emilieschario - is this in progress? We're hoping to cut an RC of 0.14.1 early next week, then publish the final 0.14.1 release later in the week. Let me know if there's anything we can help out with!

@emilieschario
Copy link
Contributor

Sorry @drewbanin I won't have the bandwidth to get to this quickly. No worries if you'd rather reassign this!

In the future, I'll make sure I have time carved out before asking for it to be assigned!

@drewbanin
Copy link
Contributor

No problem at all @emilieschario! Thanks for the update :)

@drewbanin
Copy link
Contributor

Closed by #1654

iknox-fa pushed a commit that referenced this issue Feb 8, 2022
automatic commit by git-black, original commits:
  800355e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good_first_issue Straightforward + self-contained changes, good for new contributors!
Projects
None yet
Development

No branches or pull requests

4 participants