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 factor additions do not overflow index type #645

Merged
merged 3 commits into from
Jan 11, 2024

Conversation

eddelbuettel
Copy link
Contributor

This PR adds a check for possible overflow in factor index level values when data is appended and factor levels grow. This arguably a corner case as most arrays (at least when created from R) will have an int32_t index. But as schemas can of course be based on factors with int8_t (and uint8_t, ...) it is possible. A unit test has been adding trying to write 130 distinct factor values which correctly errors with int8_t (max is 127 and lower) but passes with uint8_t.

Copy link

This pull request has been linked to Shortcut Story #39073: Ensure factor additions do not overflow index type.

@eddelbuettel eddelbuettel merged commit 7921b9b into master Jan 11, 2024
1 check passed
@eddelbuettel eddelbuettel deleted the de/sc-39073/check_factor_overflow branch January 11, 2024 16:33
@eddelbuettel eddelbuettel mentioned this pull request Feb 14, 2024
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.

2 participants