You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When reading a workflow file, ruamel.yaml is used to parse the yaml and its default behaviour is applied. The default behaviour means that all literals that have a specific meaning in yaml (such as "true", "false", integers, floats, etc.) are converted to their corresponding Python data types.
The problem is that when we report the changes that we find between two workflow files, we report them as Python objects, implying for example that key: true changed to key: false will be reported as True becoming False (where True and False are Booleans) instead of true becoming false (as strings).
A possibility would be to convert all these specific values to strings when reading them through ruamel. However, (1) it doesn't seem easy to tune ruamel to get this behaviour (it seems we'll have to change the behaviour of a subclass of the Constructor class, but support for specific data types seems to be implemented through class methods that are called explicitly); (2) this also means that our similarity function will be applied exclusively on strings, implying that the difference between (for example) True and False won't be 1 anymore, but the result of difflib.SequenceMatcher's ratio on the two strings. Similarly, comparing 11 and 12 will lead to a similarity of 50% where it is currently 0%.
To be discussed...
The text was updated successfully, but these errors were encountered:
When reading a workflow file,
ruamel.yaml
is used to parse the yaml and its default behaviour is applied. The default behaviour means that all literals that have a specific meaning in yaml (such as "true", "false", integers, floats, etc.) are converted to their corresponding Python data types.The problem is that when we report the changes that we find between two workflow files, we report them as Python objects, implying for example that
key: true
changed tokey: false
will be reported asTrue
becomingFalse
(whereTrue
andFalse
are Booleans) instead oftrue
becomingfalse
(as strings).A possibility would be to convert all these specific values to strings when reading them through
ruamel
. However, (1) it doesn't seem easy to tuneruamel
to get this behaviour (it seems we'll have to change the behaviour of a subclass of theConstructor
class, but support for specific data types seems to be implemented through class methods that are called explicitly); (2) this also means that our similarity function will be applied exclusively on strings, implying that the difference between (for example)True
andFalse
won't be 1 anymore, but the result ofdifflib.SequenceMatcher
's ratio on the two strings. Similarly, comparing11
and12
will lead to a similarity of 50% where it is currently 0%.To be discussed...
The text was updated successfully, but these errors were encountered: