Skip to content

Conversation

rambleraptor
Copy link

Rationale for this change

We currently panic if the size of an int96 isn't 12. Instead, we should return an error message to avoid a panic.

What changes are included in this PR?

Error message instead of panic.

Are these changes tested?

We typically require tests for all PRs in order to:

  1. Prevent the code from being accidentally broken by subsequent changes
  2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
Test included, existing tests should still pass.

Are there any user-facing changes?

None.

@github-actions github-actions bot added the parquet Changes to the parquet crate label Oct 13, 2025
@etseidl
Copy link
Contributor

etseidl commented Oct 14, 2025

Thanks for the submission @rambleraptor. If it's not too much to ask, could you also open an issue for this?

The test you added actually errors correctly when your change is reverted. I believe the passed-in min/max needs to be > 12 to trigger the panic. Values with a length less than 12 are correctly caught by check_len.

I'm not sure why only INT96 performs a second test and expects an exact length, all other types seem to only require at least enough data is present. Whatever wrote the data causing your issue should also be examined to see why more than 12 bytes are used for what should be a fixed-length array of length 12.

I'd probably opt for simply getting rid of the asserts, but turning the asserts into tests as you have done is probably the safer way to go. I would, however, revert the change to check_len so the behavior for too little data remains the same.

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

Labels

parquet Changes to the parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants