Skip to content

[c++] fail when forcedsplits_filename points to missing file#7197

Open
shiyu1994 wants to merge 1 commit intomasterfrom
fix/issue-6830-root
Open

[c++] fail when forcedsplits_filename points to missing file#7197
shiyu1994 wants to merge 1 commit intomasterfrom
fix/issue-6830-root

Conversation

@shiyu1994
Copy link
Copy Markdown
Collaborator

Summary

  • make GBDT fail fast when forcedsplits_filename is set but the file cannot be opened
  • add a Python test that verifies this missing-file case raises LightGBMError

Testing

  • ./lightgbm config=examples/binary_classification/train.conf data=examples/binary_classification/binary.train valid_data=examples/binary_classification/binary.test num_iterations=1 forced_splits=examples/binary_classification/does_not_exist.json
  • ./lightgbm config=examples/binary_classification/train.conf data=examples/binary_classification/binary.train valid_data=examples/binary_classification/binary.test num_iterations=1 forced_splits=examples/binary_classification/forced_splits.json
  • conda run -n lightgbm python -m pytest tests/python_package_test/test_engine.py -k "forced_split_feature_indices or forced_split_missing_file" -q

Fixes #6830

Copy link
Copy Markdown
Member

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

There is already a human-submitted PR for this issue, and it has significant discussion.

#6832

Instead of this, could you please help that move forward?

I'd also like to know... in whatever you're doing to generate these PRs, would the bot ignore issues that are already assigned? If so I think we should make a habit of assigning issues to contributors once they open PRs, to avoid PRs like this one and #7184 and #7197 being opened.

@jameslamb jameslamb added the fix label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[c++] forcedsplits_filename pointing at a non-existent file is silently ignored

2 participants