Skip to content
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 semistrictbool for fixing booleans #91

Merged
merged 9 commits into from
Feb 24, 2022
Merged

Conversation

oscarbc96
Copy link
Contributor

@oscarbc96 oscarbc96 commented Feb 23, 2022

0.16.3 - [2022-02-24]

Fixes

  • Fix resolve for bools that can be str such as "true" or "false" or similar, by making ResolvableBool to be resolvable to SemiStrictBool.

Updates

  • Update CLOUDFORMATION_ACTIONS.

@@ -19,7 +20,7 @@ def _extended_bool(value) -> bool:


class _BooleanModel(BaseModel):
bool_value: bool
bool_value: SemiStrictBool
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is not strictly necessary, it can reveted

Copy link
Member

Choose a reason for hiding this comment

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

Check 15863aa since got it reverted and test pass.

@w0rmr1d3r w0rmr1d3r marked this pull request as ready for review February 24, 2022 08:01
w0rmr1d3r
w0rmr1d3r previously approved these changes Feb 24, 2022
Copy link
Member

@w0rmr1d3r w0rmr1d3r left a comment

Choose a reason for hiding this comment

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

Talked with @oscarbc96 , approving on his behalf

return value

if isinstance(value, str) and value.lower() in ("true", "false"):
return value == "true"
Copy link
Contributor

Choose a reason for hiding this comment

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

What about if value is "True" or "TRUE"? Do we need to have value.lower() == "true"?

Copy link
Member

Choose a reason for hiding this comment

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

Made a proposal on how to solve this at df58525
@oscarbc96 can you check that possible solution as well?
Thank you both!

Copy link
Member

@w0rmr1d3r w0rmr1d3r left a comment

Choose a reason for hiding this comment

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

Talked with @oscarbc96 , approving on his behalf

@w0rmr1d3r w0rmr1d3r merged commit 29b0cd8 into master Feb 24, 2022
@w0rmr1d3r w0rmr1d3r deleted the fix_resolve_booleans_v2 branch February 24, 2022 13:40
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.

None yet

3 participants