jack harrington
02/28/2025, 3:59 PMelementary OSS for first time using dbt-core in BigQuery.
• Command : dbt run --select elementary
• Using dbt-bigquery 1.9.1
• Using
- package: elementary-data/elementary
version: 0.16.1
Got the follow error in the logs:
[error] [MainThread]: Compilation Error in model dbt_tests (models/edr/dbt_artifacts/dbt_tests.sql)
Object of type date is not JSON serializable
> in macro flatten_test (macros/edr/dbt_artifacts/upload_dbt_tests.sql)
> called by macro upload_artifacts_to_table (macros/edr/dbt_artifacts/upload_artifacts_to_table.sql)
> called by macro upload_dbt_tests (macros/edr/dbt_artifacts/upload_dbt_tests.sql)
> called by macro run_hooks (macros/materializations/hooks.sql)
> called by macro materialization_incremental_bigquery (macros/materializations/incremental.sql)
> called by model dbt_tests (models/edr/dbt_artifacts/dbt_tests.sql)Mika Kerman
03/02/2025, 12:31 PMMika Kerman
03/02/2025, 12:48 PMvar that is a date?jack harrington
03/03/2025, 12:12 PMMika Kerman
03/03/2025, 3:29 PMjack harrington
03/07/2025, 12:47 PMMika Kerman
03/10/2025, 3:54 PMDaniel Stevenson
03/11/2025, 11:47 PM# packages.yml
packages:
- package: elementary-data/elementary
version: 0.17.0
# requirements-dev.txt
elementary-data
pre-commit
sqlfluff
sqlfluff-templater-dbt
dbt-coverage
# requirements.txt
dbt-core>=1.9
dbt-postgres>=1.9
I'm getting the same exact error - I have a single custome generic test defined in tests/generic/ - see the text snippit attached. I implement it in models/schema.yml like this:
models:
- name: customer_value_model
columns:
- name: customer
- name: time
- name: value_unit
data_tests:
- test_validate_customer_monthly_sum:
customer: greatest-customer
month: 2024-01-01
expected_sum: 456.32
decimal_places: 2
Shall I simply wrap the yaml dates in single quotes?Daniel Stevenson
03/12/2025, 1:52 AMShall I simply wrap the yaml dates in single quotes? (edited) that worked!Mika Kerman
03/12/2025, 8:47 AM