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

Ensure Partition Specs can only contain primitive types #780

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Lordworms
Copy link

@Lordworms Lordworms commented Dec 12, 2024

Closes #718

@Fokko Fokko requested a review from c-thiel December 20, 2024 12:43

if !field_type.is_primitive() {
return Err(serde::de::Error::invalid_type(
Unexpected::Other("non-primitive field type"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we help the user here by adding the source-id to the error?

Suggested change
Unexpected::Other("non-primitive field type"),
Unexpected::Other("non-primitive field type"),

let field_type = raw_spec
.schema
.field_by_id(field.source_id)
.ok_or_else(|| serde::de::Error::custom("Invalid value"))?
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, can we add the field-id that cannot be found?

Suggested change
.ok_or_else(|| serde::de::Error::custom("Invalid value"))?
.ok_or_else(|| serde::de::Error::custom("Invalid value"))?

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.

Ensure Partition Specs can only contain primitive types
2 participants