fix(segments): Support NoneType. (#6581)
This commit is contained in:
parent
75445a0c66
commit
2bc0632d0d
6 changed files with 45 additions and 4 deletions
|
|
@ -10,6 +10,7 @@ from .variables import (
|
|||
FileVariable,
|
||||
FloatVariable,
|
||||
IntegerVariable,
|
||||
NoneVariable,
|
||||
ObjectVariable,
|
||||
SecretVariable,
|
||||
StringVariable,
|
||||
|
|
@ -39,6 +40,8 @@ def build_variable_from_mapping(m: Mapping[str, Any], /) -> Variable:
|
|||
|
||||
|
||||
def build_anonymous_variable(value: Any, /) -> Variable:
|
||||
if value is None:
|
||||
return NoneVariable(name='anonymous')
|
||||
if isinstance(value, str):
|
||||
return StringVariable(name='anonymous', value=value)
|
||||
if isinstance(value, int):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue