Skip to content

Commit

Permalink
Coerce None in xtrigger args.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Jun 13, 2024
1 parent 9e73bf4 commit bc709cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cylc/flow/parsec/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ def coerce_xtrigger(cls, value, keys):

@classmethod
def _coerce_type(cls, value):
"""Convert value to int, float, or bool, if possible.
"""Convert value to int, float, bool, or None, if possible.
Examples:
>>> CylcConfigValidator._coerce_type('1')
Expand All @@ -1147,6 +1147,7 @@ def _coerce_type(cls, value):
True
>>> CylcConfigValidator._coerce_type('abc')
'abc'
>>> CylcConfigValidator._coerce_type('None')
"""
try:
Expand All @@ -1159,6 +1160,8 @@ def _coerce_type(cls, value):
val = False
elif value == 'True':
val = True
elif value == 'None':
val = None
else:
# Leave as string.
val = cls.strip_and_unquote([], value)
Expand Down

0 comments on commit bc709cb

Please sign in to comment.