Skip to content

fix: handle SampleWindow serialization (#542)#543

Open
Borisdejonge wants to merge 1 commit intobrooklyn-data:mainfrom
Borisdejonge:fix/542-sample-window-serialization
Open

fix: handle SampleWindow serialization (#542)#543
Borisdejonge wants to merge 1 commit intobrooklyn-data:mainfrom
Borisdejonge:fix/542-sample-window-serialization

Conversation

@Borisdejonge
Copy link

Overview

Fixes #542

When using dbt's --sample flag, the SampleWindow object in invocation_args_dict
is not JSON serializable. This fix handles it the same way warn_error_options is
handled - by converting it to a serializable dict before passing to safe_copy_mapping.

Update type - breaking / non-breaking

  • Minor bug fix
  • Documentation improvements
  • Quality of Life improvements
  • New features (non-breaking change)
  • New features (breaking change)
  • Other (non-breaking change)
  • Other (breaking change)
  • Release preparation

What does this solve?

Fixes #542 - SampleWindow object not JSON serializable when using --sample flag.

The --sample flag (introduced in dbt for event_time based sampling) adds a
SampleWindow Python object to invocation_args_dict. This object cannot be
serialized to JSON, causing upload_invocations to fail.

Outstanding questions

None - the fix follows the existing pattern used for warn_error_options.

What databases have you tested with?

  • Snowflake
  • Google BigQuery
  • Databricks
  • Spark
  • N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant