Skip to content

Ensure factor additions do not overflow index type#645

Merged
eddelbuettel merged 3 commits intomasterfrom
de/sc-39073/check_factor_overflow
Jan 11, 2024
Merged

Ensure factor additions do not overflow index type#645
eddelbuettel merged 3 commits intomasterfrom
de/sc-39073/check_factor_overflow

Conversation

@eddelbuettel
Copy link
Copy Markdown
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.

@shortcut-integration
Copy link
Copy Markdown

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
@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