Skip to content

[python-package] Add tests for passing Arrow arrays with empty chunks - #6210

Merged
jameslamb merged 6 commits into
lightgbm-org:masterfrom
borchero:empty-chunk-tests
Dec 10, 2023
Merged

jameslamb merged 6 commits into
lightgbm-org:masterfrom
borchero:empty-chunk-tests

Conversation

@borchero

Copy link
Copy Markdown
Member

Motivation

Follow-up from #6166. Thanks a lot for proposing this test @jameslamb, it actually caught an error in the C++ code! I'm now ignoring empty chunks as keeping them around would make life hard (.begin() couldn't be O(1) anymore which violates assumptions about iterators).

Turns out we just got lucky in #6166 as the chunked array being initialized is contiguous in memory...

@jameslamb jameslamb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey great, thanks for looking into this!

I agree with skipping them. I can't think of a reason LightGBM should need to care about preserving the empty chunks on its side... it just wants to get from raw input data (chunked array) to the format for training (LightGBM Dataset) correctly and efficiently.

@jameslamb
jameslamb merged commit 522f0f0 into lightgbm-org:master Dec 10, 2023
@borchero
borchero deleted the empty-chunk-tests branch December 11, 2023 02:30
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants