Skip to content

Commit

Permalink
Fix fn _has_one_unfilled_arg in build_pipeline to correctly check the…
Browse files Browse the repository at this point in the history
… default value of the parameters

Restricts the maximum version of lightgbm to 4.5
  • Loading branch information
spinosaphb committed Feb 26, 2025
1 parent 64bd8c7 commit ba5cba5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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
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 ba5cba5

Please sign in to comment.