fix: create null-filled columns for remaining names in split into#1776
Merged
Jolanrensen merged 3 commits intoKotlin:masterfrom Mar 31, 2026
Merged
fix: create null-filled columns for remaining names in split into#1776Jolanrensen merged 3 commits intoKotlin:masterfrom
Jolanrensen merged 3 commits intoKotlin:masterfrom
Conversation
- add null-filled columns when explicit names exceed list elements - add tests for null filled columns, exact elements, all empty lists and mixed lists
Jolanrensen
requested changes
Mar 30, 2026
| res["a2"][2] shouldBe null | ||
| res["a3"][2] shouldBe null | ||
| } | ||
| @Test |
Collaborator
There was a problem hiding this comment.
please run ktlintFormat
|
|
||
| repeat(names.size - columnCollectors.size) { | ||
| val collector = createDataCollector(nrow) | ||
| repeat(nrow) { collector.add(clause.default) } |
Collaborator
There was a problem hiding this comment.
good job using .default! That's even better than simply adding null. Could you add a test where this default is changed, though? with split { ... }.default("something")...
Collaborator
There was a problem hiding this comment.
and use both String and lists in your tests :) so we cover them both
Author
There was a problem hiding this comment.
Added tests for both lists and strings as requested. Also ran ktlintFormat.
Cover custom default behavior for: - Lists with missing values - Empty lists - String splitting with delimiter - Cases where default is not used
koperagen
approved these changes
Mar 30, 2026
Jolanrensen
approved these changes
Mar 31, 2026
Collaborator
|
Thanks! I've run our CI and all seems well |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1758
The fix was made in the
splitImplfunction inSplit.kt.When the number of explicit names exceeds the number of elements
in the list, null-filled collectors are now created for the remaining columns.