Skip to content

Commit

Permalink
Bug fix (#241)
Browse files Browse the repository at this point in the history
* Fix fn _has_one_unfilled_arg in build_pipeline to correctly check the default value of the parameters
Restricts the maximum version of lightgbm to 4.5

* lint fix

* Update version and changelog
  • Loading branch information
spinosaphb authored Feb 26, 2025
1 parent 64bd8c7 commit 8c15e83
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [4.0.1] - 2025-02-26
- **Bug Fix**
- Fix fn _has_one_unfilled_arg in build_pipeline to correctly check the default value of the parameters
- Restricts the maximum version of lightgbm to 4.5

## [4.0.0] - 2024-08-12
- **Enhancement**
- Add support for python 3.11 and 3.10
Expand Down
2 changes: 1 addition & 1 deletion requirements_lgbm.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lightgbm>=4,<5
lightgbm>=4,<4.6
2 changes: 1 addition & 1 deletion src/fklearn/resources/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.0
4.0.1
5 changes: 4 additions & 1 deletion src/fklearn/training/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def build_pipeline(*learners: LearnerFnType, has_repeated_learners: bool = False
"""

def _has_one_unfilled_arg(learner: LearnerFnType) -> None:
no_default_list = [p for p, a in signature(learner).parameters.items() if a.default == '__no__default__']
no_default_list = [
p for p, a in signature(learner).parameters.items()
if isinstance(a.default, str) and a.default == '__no__default__'
]
if len(no_default_list) > 1:
raise ValueError("Learner {0} has more than one unfilled argument: {1}\n"
"Make sure all learners are curried properly and only require one argument,"
Expand Down

0 comments on commit 8c15e83

Please sign in to comment.