You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
The run_query operation in expect_row_values_to_have_data_for_every_n_datepart can fail if test_start_date or test_end_date are not specified and the model dbt-expectations is testing hasn't been created yet in the target DB.
In our case, this happens at the dbt compile step in a CI build that validates the dbt project associated with a PR is able to compile.
While I don't expect tests to pass if a model doesn't exist in a DB, I do generally want compile to complete, and this blocks that.
Expected Behavior
dbt compile is able to complete when using expect_row_values_to_have_data_for_every_n_datepart even if dbt build/run hasn't been run on a model yet.
Steps To Reproduce
Create a new model and don't run it.
# models/datamart/expectations_test.sql
{{config(
schema='datamart',
materialized='view',
) }}
select'2023-01-01'::dateas foo
union allselect'2023-01-02'::dateas foo
union allselect'2023-01-03'::dateas foo
union allselect'2023-01-04'::dateas foo
union allselect'2023-01-05'::dateas foo
Create a expect_row_values_to_have_data_for_every_n_datepart against that new model
I don't have any great suggestions on how to fix this beyond making the date boundary required - being able to use expect_row_values_to_have_data_for_every_n_datepart without a date boundary is a nice feature.
The text was updated successfully, but these errors were encountered:
Is this a new bug in dbt-expectations?
Current Behavior
The
run_query
operation inexpect_row_values_to_have_data_for_every_n_datepart
can fail iftest_start_date
ortest_end_date
are not specified and the modeldbt-expectations
is testing hasn't been created yet in the target DB.In our case, this happens at the
dbt compile
step in a CI build that validates the dbt project associated with a PR is able to compile.While I don't expect tests to pass if a model doesn't exist in a DB, I do generally want
compile
to complete, and this blocks that.Expected Behavior
dbt compile
is able to complete when usingexpect_row_values_to_have_data_for_every_n_datepart
even ifdbt build/run
hasn't been run on a model yet.Steps To Reproduce
expect_row_values_to_have_data_for_every_n_datepart
against that new modelEnvironment
Which database adapter are you using with dbt?
Snowflake
Additional Context
I don't have any great suggestions on how to fix this beyond making the date boundary required - being able to use
expect_row_values_to_have_data_for_every_n_datepart
without a date boundary is a nice feature.The text was updated successfully, but these errors were encountered: