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

[R-package] Allow for valid data to be a slice of the main lgb.Dataset by setting references if one does not exist. #6844

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

walkerjameschris
Copy link

@walkerjameschris walkerjameschris commented Feb 28, 2025

fixes #6008

Slices of datasets already contain a reference to the base data. This change only sets a reference to the base dataset if one does not already exist.

Slices of datasets already contain a reference to the base data (e.g., R/lgb.Dataset.R:562). This change only sets a reference to the base dataset if one does not already exist.
@jameslamb jameslamb changed the title Allow for valid data to be a slice of the main lgb.Dataset by setting references if one does not exist. [R-package] Allow for valid data to be a slice of the main lgb.Dataset by setting references if one does not exist. Feb 28, 2025
Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

Thanks for taking the time to contribute!

I've added a link to #6008 to the description... please do that when you contribute in the future and where your contribution is related to previous discussions. It helps to answer the question "what is the benefit of this change?" for reviewers.

Before we review this closely (I haven't yet), please also add a unit test covering this behavior. That'll help build our confidence in this fix, and prevent the bug from being reintroduced in the future.

Add that somewhere in https://github.com/microsoft/LightGBM/blob/master/R-package/tests/testthat/test_basic.R. Try to put it near related tests, and follow all the patterns you see there (for code style, passing .LGB_VERBOSITY. and .LGB_MAX_THREADS, etc.).

@walkerjameschris
Copy link
Author

@microsoft-github-policy-service agree

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

Successfully merging this pull request may close these issues.

[R-package] lgb.Dataset with free_raw_data = FALSE still raises an error
2 participants