Skip to content

node.pyx: Support loading 0/1 as boolean values#2011

Merged
gtristan merged 4 commits intomasterfrom
tristan/fix-boolean-parsing
May 23, 2025
Merged

node.pyx: Support loading 0/1 as boolean values#2011
gtristan merged 4 commits intomasterfrom
tristan/fix-boolean-parsing

Conversation

@gtristan
Copy link
Contributor

It turns out that since OptionBool.get_value() is serializing boolean values as "0"/"1", we must support this in node parsing.

This is because we should be able to use option value exporting to values, which can subsequently be specified in plugin configuration which wants to use MappingNode.get_bool().

Fixes #2006

gtristan added 3 commits May 21, 2025 18:29
This oddly suddenly started causing my compiler to crash locally
today, and the raise statement does appear dubious, and the string
formatting has too many arguments, bool.__name__ appears to trigger
the compiler crash.
It turns out that since OptionBool.get_value() is serializing boolean
values as "0"/"1", we must support this in node parsing.

This is because we should be able to use option value exporting
to values, which can subsequently be specified in plugin configuration
which wants to use MappingNode.get_bool().

Fixes #2006
…lues

This simply ensures that the values which got exported can be directly
consumed by plugin node configuration.
This test was checking validity of yaml configuration, and now
that "1"/"0" are valid boolean values, this test needed to be updated.
@gtristan gtristan merged commit 874f0b7 into master May 23, 2025
17 checks passed
@gtristan gtristan deleted the tristan/fix-boolean-parsing branch May 23, 2025 03:56
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.

Variables from boolean project options resolved to 0/1 instead of true/false

1 participant