-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[CT-2083] [Bug] Store failures log message keeps reporting the failures table as None #6930
Comments
@jsnb-devoted Thanks for opening! I wasn't able to reproduce this quickly, when I tried just now: -- models/my_model.sql
select 1 as id
union all
select 1 as id # models/schema.yml
version: 2
models:
- name: my_model
columns:
- name: id
tests:
- unique $ dbt build --store-failures
23:57:38 Running with dbt=1.4.1
...
23:57:39 Failure in test unique_my_model_id (models/schema.yml)
23:57:39 Got 1 result, configured to fail if != 0
23:57:39
23:57:39 compiled Code at target/compiled/test/models/schema.yml/unique_my_model_id.sql
23:57:39
23:57:39 See test failures:
-----------------------------------------------------------------------
select * from "jerco"."dbt_jcohen_dbt_test__audit"."unique_my_model_id"
-----------------------------------------------------------------------
23:57:39
23:57:39 Done. PASS=2 WARN=0 ERROR=1 SKIP=0 TOTAL=3 So, some follow-up questions that may (or may not) help with debugging, and getting to a reproduction case:
|
Thanks for taking a look at this @jtcohen6 -- that definitely makes me think it is us. I'm AFK for a bit but I will check out the manifest first thing tomorrow. |
As you expected -- This has happened for all test failures that I have seen so far. Not sure I have a great way of confirming it is truly 100% of them. For this case I ran/tested the model directly:
Below is the full node from the manifest:
|
One other data point to add is that the test audit table |
For tests the relation_name is only set if "store_failures" is set in the test config, and it isn't for that test node: "store_failures": null. The logging message should be fixed though, to not display that query when there is no relation_name. What are you using that logging message for if you're not storing the failures for the test? |
@gshank -- we aren't setting the We use the flag so that it can be an opt in feature decided by the developer in the orchestration code. |
Okay, the problem is that we moved generation of relation_name to parse time. The manifest is probably generated in a prior run (not the one with --store-failures), and so when the test command is run, the relation_name is not set in the test nodes. We could either re-generate the relation_name at compile time or always set it on tests. My inclination would be to re-generate it at compile time, but I'll let @jtcohen6 weigh in on that. |
Ah, right, this makes sense! The parse took place without |
Is this a new bug in dbt-core?
Current Behavior
I didn't see anyone mention this yet so I'm not ruling out that it is user error somewhere but after upgrading to 1.4.1 all of our test failure logs stopped showing the
--store-failures
table in the query:Expected Behavior
Steps To Reproduce
dbt test
with any failing testsRelevant log output
No response
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
I tried poking around the new logging code to see if there was something obvious. It looks like the property that it is trying to print is
self.relation_name
but I don't know what should go there in its place. (code)The text was updated successfully, but these errors were encountered: