Hi all, I have a pretty newbie question, once the ...
# community-support
y
Hi all, I have a pretty newbie question, once the elementary package is installed (part of our github workflow), I can see the hooks running but the table
dbt_run_results
only contains the test results which we are running using
dbt run --target elementary
. We can't use that target in the generation of our models in production though, so it seems that I am missing something here because I thought that those hooks are used to collect the run results by default and append them to
dbt_run_results
? Thank you so much!
e
Hi @Yassmine Chebaro , The artifacts and test results are added to the tables in the Elementary schema during the on-run-end hooks (more about that here). So they should be uploaded whenever you run your production dbt models. If they are not, please try to check if the on-run-end hooks are running and succeeding.
w
Hi @Ella Katz, Yassmine and I work together. From what I can understand, our on-run-end hooks are running without failure, but they are not updating the tables. Could I share our most recent log files with you?
e
Hi @Will Seaton, Can you please check if your elementary hooks are disabled? That can be the case if any of the following vars are defined in your command or dbt project yml:
Copy code
disable_run_results
disable_tests_results
disable_dbt_invocation_autoupload
disable_dbt_artifacts_autoupload
w
I don't see any of the variables defined in the commands or the project yml. We see Elementary hooks running after our models in production now, like below:
We don't need to explicitly run Elementary after every model run to update the Elementary tables, the hooks alone should be able to do that, correct?
e
Yes they should, but the 0.0 seconds runtime makes it look like they are not doing anything 🤔 Do you have rows in elementary_test_results without having to run the additional command? Or are those empty too?
w
We also thought the 0.0 seconds was strange, but we get the same runtime for our tests and those load correctly. So, yes, we do have results in elementary_test_results, but we do run the Elementary GitHub Action and generate our report directly after the tests if that counts for anything.
e
OK just tested it and I get the 0.0 seconds too. In your dbt.log of your production models run, can you find the following log:
Copy code
Elementary: Uploading run results.
? If you do, the rows in the log after that should be the queries uploading the run results. let me know if this helps
w
I searched with Cmd + F, but didn't find the log unfortunately.
Specifically, I did not find the line you shared in the dbt.log.
e
did you find any logs from other on-run-end hooks? artifact upload? you can send me the log and I'll try to take a look as well. My suspicion is that the different targets are somehow causing the run results to be written to another location, but I can't be sure. Can you tell me a little about your setup? How are you uploading test results vs. run results?
w
Our set up is a large number of automated jobs via GitHub Actions. These jobs install Elementary as part of dbt deps and so the hooks are triggered on all of them. However, the only workflow that seems work as intended is our workflow to create and host the Elementary report. This is a dedicated workflow that runs the Elementary models, runs all of our repos tests, then runs Elementary and generates the report and logs which are sent to a different repo to host the report via GitHub pages. The test results from the dedicated workflow are successfully written to the tables and populate the report as expected, but we do not have any data on model runtime or models success/failure being saved. I managed to save model run metadata when running locally, but this isn't a sustainable option for us.
We have too many models to reasonably run all at once in the dedicated run, which is why we are hoping to leverage the on-run-end hooks as they occur, versus rerunning all the models in the dedicated Elementary workflow. It feels a little silly for us to expect it to work for the models when it didn't work for our tests, but if there's a way to make it work, that would be ideal.
We generate artifacts with every new PR, but otherwise logs are only saved when we run a dedicated Elementary workflow. I'll need to double check before I can share these. If you want to look at specific files like the GitHub workflow or dbt_project.yml, let me know as well
e
yeah can you send me the github workflow you're using to run your models?
more specifically, when using elementary in your dbt project you need to run
dbt run -s elementary
after installing it with
dbt deps
. can you confirm that you're doing it?
👀 1
w
Oh no, I think that's definitely it. We forgot to add
dbt run -s elementary
to the other jobs...🤦‍♂️
e
Got it. So it's working now?
w
I was out of office last week so I'm only testing it out now, but I'll let you know the outcome.