fix:boolean parameter without defaullt value defaults to False#352
Open
DimitriKwihangana wants to merge 4 commits intomainfrom
Open
Conversation
yolanfery
requested changes
Feb 3, 2026
openhexa/sdk/pipelines/parameter.py
Outdated
Comment on lines
527
to
528
| elif normalized_value is None and isinstance(self.type, Boolean) and self.required: | ||
| normalized_value = False # Required booleans default to False when no default is set |
Contributor
There was a problem hiding this comment.
Can't this be moved to
if normalized_value is None:
if self.required:
raise ParameterValueError(f"{self.code} is required")
To avoid duplication of condition check ?
Contributor
There was a problem hiding this comment.
Agreed, also: we can always default booleans that are None to False, regardless of if they're required
| normalized_value = self.default | ||
| elif normalized_value is None and isinstance(self.type, Boolean) and self.required: | ||
| normalized_value = False # Required booleans default to False when no default is set | ||
|
|
Contributor
There was a problem hiding this comment.
I propose to add a unit test to cover this edge case
Contributor
There was a problem hiding this comment.
(This ensures that we avoid regressions in the future but also it greatly simplifies code reviews, if the test coverage is good and the intent of tests are good we might not need to pull up the code and test)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix the behavior of boolean parameters in the pipeline launcher widget. When a boolean parameter is defined without a default value, userswere getting a validation error ("parameter is required") instead of the parameter defaulting to False.
Changes
error
How to test