-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
add ChoiceListParameter #3305
add ChoiceListParameter #3305
Conversation
test/choice_list_parameter_test.py
Outdated
import luigi | ||
|
||
|
||
class ChoiceListParameterTest(unittest.TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests should be put into test/parameter_test.py
luigi/parameter.py
Outdated
@@ -1540,6 +1540,66 @@ def normalize(self, var): | |||
var=var, choices=self._choices)) | |||
|
|||
|
|||
class ChoiceListParameter(Parameter): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine with me with one exception. If this class is intended to be a multi-select of ChoiceParameter
, it's counter to object-oriented for it to not inherit from ChoiceParameter
(or a common Choice-based parent) such for them to maintain alignment of their choice parsing and validation.
What are your thoughts?
46961b3
to
2fe6a09
Compare
@dlstadther Thank you for the review! and I'm sorry for the late response. I fixed test and ListChoiceParameter inheritance. |
@kitagry , could you take a look at the failing tests? I've restarted those which failed to check on potentially flakey tests (i know there are a couple luigi tests which sometimes fail and sometimes pass). |
2fe6a09
to
ff7d87b
Compare
Thank you! |
Description
A parameter type complementary to ChoiceParameter that allows for an arbitrarily sized list (0 to n).
Motivation and Context
Convenient addition to the Luigi parameter type inventory.
Have you tested this? If so, how?
I have included unit tests.