Hi, I implemented elementary into my dbt flows and...
# community-support
y
Hi, I implemented elementary into my dbt flows and encountered a weird situation. I use version 0.16.1 and I use Snowflake. The problem is while some of my flows was able to generate reports using
edr report
others fail to do. When I check out the errors, I see the following situation: If the flow has been run for the first time and have errors while running
dbt build
(could be a test failure or a missing model causing other models to fail), then no object is created under YOUR_SCHEMA_ELEMENTARY schema. This causes
<YOUR_SCHEMA>_ELEMENTARY.ELEMENTARY_RESULTS
not found error. This is the case where I tried
jaffle-shop
example from dbt itself and it failed for the first time. I am not sure if I detected the root cause of the problem correctly. If this is not something expected I will try to find out the real problem.
n
Hey Yunus! Interesting. Did you try running
dbt run --select elementary
before
dbt build
? If this doesn't help, can you please share the error you're receiving? 🙂
y
Since
dbt build
runs all of the models and tests I did not run elementary models as a prerequisite. It worked for a very basic dbt project.
I was expecting to see at least empty tables under _ELEMENTARY schema allowing
edr report
to run without raising errors.
n
The Elementary models are updated by on run end hooks, and require this command to be built before other dbt commands 🙂 And I understand, what you're expecting makes sense. Did it fail on a different project or a different flow?
y
Ok, I am trying to understand. Since
dbt build
also runs
dbt run --select elementary
under the hood and the elementary models are updated when
dbt build
finished, then there shouldn't be no problem?
I am sharing error trace, just a second.
Untitled
n
Thank you! I think the original explanation you provided was correct - the Elementary tables are not built because
dbt build
is failing before the on-run-hooks that create them. Running them explicitly once should solve this. Can you try and let me know if it helps? Taking a look at the error logs as well to understand better 🙌
y
The error trace is to long, I tried to share it as not a text file but couldnt
Ok, I will try and inform you. Thank you
drop stoked 1
Hi @Noya Offer, I am on the way to implementation of
dbt run -s elementary
. I run my dbt projects using a custom script. The script runs the followings in order: 1.
dbt deps
2.
dbt compile
3.
dbt build
4.
edr report
I wonder if there is any downside of running
dbt run -s elementary
between steps 2 and 3 each time I start running the project?
My custom script is responsible for running above commands for a specified dbt project. It is the orchestrator.
n
This should once just to initially build them. After they're built, you should only run this command on minor version updates 🙂 Taking a look at the other issue as well!
y
Okey I got it. But I am asking that whether running this command more than needed will cause a problem or not?
n
No, it's harmless 😌
👍 1