Skip to content

.with_materializers() added helpful error message#986

Merged
skrawcz merged 2 commits intomainfrom
fix/better-with-materializer-error
Jun 27, 2024
Merged

.with_materializers() added helpful error message#986
skrawcz merged 2 commits intomainfrom
fix/better-with-materializer-error

Conversation

@zilto
Copy link
Contributor

@zilto zilto commented Jun 25, 2024

When first using .with_materializers(), it's not obvious that it expects:

.with_materializers(to.json(...), to.parquet(...))

Rather than the invalid:

.with_materializers([to.json(...), to.parquet(...)])

If encountering the above case, the error will now specify to unpack the sequence with *, leading to the valid code

.with_materializers(*[to.json(...), to.parquet(...)])

Changes

  • explicitly catch an invalid argument for .with_materializers() when building the driver

@zilto zilto added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 25, 2024
Copy link
Contributor

@skrawcz skrawcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a unit test for this please.

@skrawcz skrawcz merged commit b836e19 into main Jun 27, 2024
@skrawcz skrawcz deleted the fix/better-with-materializer-error branch June 27, 2024 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants