Skip to content

[BUG] dbt_expectations {{ DBT_EXPECTATIONS.TYPE_DATETIME() }} not being rendered #250

@dbeatty10

Description

@dbeatty10

Describe the bug

    Failed target/generic_tests/dbt_expectations_expect_column_values_to_be_in_type_list_timeseries_data_date_datetime__date__dbt_expectations_type_datetime.sql

Here's the SQL that is executing and returning non-zero rows (zero rows indicates pass, otherwise fail).

Here's the row(s) indicating failure:

Image

Root cause

Looks like the root cause is that there's some Jinja not being rendered prior to execution:

            relation_column_type not in ('DATE', '{{ DBT_EXPECTATIONS.TYPE_DATETIME() }}')

What version of dbt Fusion is this bug in? (find out by running dbt --version)

Is this a discrepancy between the dbt Fusion Engine and dbt Core? Check one.

  • YES
  • NO

To Reproduce

Instructions here.

cd integration_tests
dbt build --select test.dbt_expectations_integration_tests.dbt_expectations_expect_column_values_to_be_in_type_list_timeseries_data_date_datetime__date__dbt_expectations_type_datetime

Expected behavior

Pass without any errors.

Full log output

dbt-fusion 2.0.0-beta.24
   Loading profiles.yml
  Fetching packages.yml
   Loading dbt_project.yml
   Loading dbt_packages/dbt_date/dbt_project.yml
   Loading dbt_packages/dbt_expectations/dbt_project.yml
   Loading dbt_internal_packages/dbt-adapters/dbt_project.yml
   Loading dbt_internal_packages/dbt-snowflake/dbt_project.yml
warning: dbt1000: Detected nodes with unsafe introspection, skipping static analysis for these nodes and their downstreams. To enable unsafe static analysis, set static_analysis to 'unsafe' in the nodes configuration. Nodes: 'model.dbt_expectations_integration_tests.timeseries_base' (execute), 'model.dbt_expectations_integration_tests.timeseries_hourly' (execute)
 Rendering models/schema_tests/timeseries_base.sql
 Rendering models/schema_tests/timeseries_data.sql
   Running target/generic_tests/dbt_expectations_expect_column_values_to_be_in_type_list_timeseries_data_date_datetime__date__dbt_expectations_type_datetime.sql
    Failed target/generic_tests/dbt_expectations_expect_column_values_to_be_in_type_list_timeseries_data_date_datetime__date__dbt_expectations_type_datetime.sql
  Finished 'build' target 'snowflake' with 1 error and 1 warning in 2s 901ms 575us

Operating System and CPU Type (please complete the following information):

  • Mac/Windows/Linux? N/A
  • X86 or ARM? N/A

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpackage

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions