Skip to content

[Bug]: SampleWindow object not JSON serializable when using --sample flag #542

@Borisdejonge

Description

@Borisdejonge

Overview

When using dbt's --sample flag, the upload_invocations macro fails:
Compilation Error in operation -on-run-end-0
Object of type SampleWindow is not JSON serializable

How to reproduce

dbt build --sample '{"start": "2024-01-01", "end": "2099-12-31"}'

Expected behaviour

Invocation upload should succeed, with sample window serialized as a dict.

Environment

Results of running dbt --version:

Core:
  - installed: 1.11.2
  - latest:    1.11.2

Plugins:
  - databricks: 1.11.4
  - spark:      1.10.0
packages:
  - name: dbt_expectations
    package: metaplane/dbt_expectations
    version: 0.10.9
  - name: dbt_utils
    package: dbt-labs/dbt_utils
    version: 1.3.0
  - name: dbt_artifacts
    package: brooklyn-data/dbt_artifacts
    version: 2.10.0
  - name: audit_helper
    package: dbt-labs/audit_helper
    version: 0.12.2
  - name: dbt_date
    package: godatadriven/dbt_date
    version: 0.17.1  

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions