Issue when running `elementary` OSS for first time...
# community-support
j
Issue when running
elementary
OSS for first time using
dbt-core
in BigQuery. • Command :
dbt run --select elementary
• Using
dbt-bigquery
1.9.1
• Using
Copy code
- package: elementary-data/elementary
    version: 0.16.1
Got the follow error in the logs:
Copy code
[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)
m
Do you have date / datetimes in any of the meta fields?
Or do you maybe have a
var
that is a date?
j
Strangely, I don't think we have either 🤔 I will do a deep dive and double check though
m
Do you perhaps see any other error logs or python traceback that can help us understand where this date field is coming from?
j
It looks like I do have tests which accept date types as arguments
m
Could you provide an example of one so we can replicate the error?
d
Hi! Thanks for the cool OSS work!
Copy code
# packages.yml
packages:
  - package: elementary-data/elementary
    version: 0.17.0
Copy code
# requirements-dev.txt
elementary-data
pre-commit
sqlfluff
sqlfluff-templater-dbt
dbt-coverage
Copy code
# 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:
Copy code
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?
Shall I simply wrap the yaml dates in single quotes? (edited)
that worked!
🔥 1
m
nice!