Skip to content

[python-package] remove unnecessary LGBM_BoosterGetCurrentIteration() call#7350

Open
jameslamb wants to merge 1 commit into
mainfrom
simplify-inner-predictor
Open

[python-package] remove unnecessary LGBM_BoosterGetCurrentIteration() call#7350
jameslamb wants to merge 1 commit into
mainfrom
simplify-inner-predictor

Conversation

@jameslamb

Copy link
Copy Markdown
Member

_InnerPredictor.from_booster() calls LGBM_BoosterGetCurrentIteration() but doesn't do anything with the return value. I don't think the package is depending on any side effect from that call and I don't see a place where _InnerPredictor would need that value, so I think this is just unnecessary code left behind by the refactoring in #5961

This removes it.

"""
# ensure that existing Booster is freed before replacing it
# with a new one createdfrom file
# with a new one created from file

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

noticed this typo when looking back at the diff of #5961 and oop, it's still here 3 years later 😅

@jameslamb jameslamb changed the title WIP: [python-package] remove unnecessary LGBM_BoosterGetCurrentIteration() [python-package] remove unnecessary LGBM_BoosterGetCurrentIteration() Jul 3, 2026
@jameslamb jameslamb marked this pull request as ready for review July 4, 2026 01:32
@jameslamb jameslamb changed the title [python-package] remove unnecessary LGBM_BoosterGetCurrentIteration() [python-package] remove unnecessary LGBM_BoosterGetCurrentIteration() call Jul 5, 2026
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.

1 participant