Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Object of type date is not JSON serializable #416

Open
taylorterwin opened this issue Dec 26, 2023 · 1 comment
Open

[Bug]: Object of type date is not JSON serializable #416

taylorterwin opened this issue Dec 26, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@taylorterwin
Copy link

Overview

When using dbt_artifacts package on dbt versions > 1.4 version, running errors upon uploading artifacts with following error for on-run-end: - "{{ dbt_artifacts.upload_results(results) }}"), and it does not upload full artifacts to Snowflake as per functionalities.

`21:29:18 Running with dbt=1.6.9

21:29:18 Registered adapter: snowflake=1.6.6

21:29:19 [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. There are 2 unused configuration paths: - models.PLI_PROJECT.presentation.analytics - models.PLI_PROJECT.example

21:29:19 Found 74 models, 1 snapshot, 7 analyses, 21 tests, 1 seed, 1 operation, 16 sources, 0 exposures, 0 metrics, 882 macros, 0 groups, 0 semantic models

21:29:22 Concurrency: 4 threads (target='dev')

21:29:25 Running 1 on-run-end hook

21:29:27 Database error while running on-run-end

21:29:27 Finished running 4 tests in 0 hours 0 minutes and 7.87 seconds (7.87s).

21:29:27 Completed with 1 error and 0 warnings:

21:29:27 on-run-end failed, error: Object of type date is not JSON serializable

21:29:27 Done. PASS=4 WARN=0 ERROR=1 SKIP=0 TOTAL=5

Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7f41496b4220>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7f41496b43d0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7f41496b4dc0>]}
`

How to reproduce

dbt version 1.6 with snowflake adapter 1.6.6
run dbt artifacts dbt run --select dbt_artifacts

Expected behaviour

completed on-run-end-hook and upload of artifacts to snowflake

Environment

dbt=1.6.9
snowflake=1.6.6

Please paste the contents of your packages.yml file here:

`packages:

  - package: dbt-labs/codegen

    version: 0.10.0

  - package: calogica/dbt_expectations

    version: [">=0.9.0", "<0.10.0"]

    # <see https://github.com/calogica/dbt-expectations/releases/latest> for the latest version tag

  - package: brooklyn-data/dbt_artifacts

    version: 2.6.2  

  - package: dbt-labs/dbt_utils

    version: 1.1.1

  - package: dbt-labs/dbt_external_tables

    version: <2.0.0`
@taylorterwin taylorterwin added the bug Something isn't working label Dec 26, 2023
@owenprough-sift
Copy link

I encountered this same error on dbt-postgres==1.8.5 also, specifically when my dbt invocation included --vars {my_date: 2024-09-06}. After some digging, I found dbt-labs/dbt-core#10556 (comment), which provided a workaround of instead specifying --vars {my_date: !!str 2024-09-06}. Maybe this will help someone else who stumbles across this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants