Skip to content

Conversation

@claudiazi
Copy link

The validator=bool was not working as expected.
This is how it works:
Screenshot 2025-04-25 at 09 50 04

if we use validator=bool,
then the parsed_value = bool(input_value)

However, this will be the result of some examples:

bool("")      # False, because the empty string is “falsy”
bool("False") # True, because any non‐empty string is “truthy”
bool("foo")   # True

So:
"" → False
anything else (e.g. "False", "0", "anything") → True

This is not what we want. So, we should use str as validator and then use parse_boolean as type in the python script to handle this input.

@claudiazi claudiazi requested a review from a team as a code owner April 25, 2025 08:06
Copy link

@raimundovidaljunior raimundovidaljunior left a comment

Choose a reason for hiding this comment

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

lgtm. I wonder if this affects any other job, maybe it's worth to check

@claudiazi
Copy link
Author

claudiazi commented Apr 25, 2025

@raimundovidaljunior yeeesss!!! totally agree!

@claudiazi claudiazi merged commit a199e63 into master Apr 25, 2025
1 check passed
@raimundovidaljunior
Copy link

I think we should fix the validator on dagger nontheless

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants