Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/python_workflow_definition/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
"PythonWorkflowDefinitionWorkflow",
)

JsonPrimitive = Union[str, int, float, bool, None]
AllowableDefaults = TypeAliasType(
"AllowableDefaults", "Union[JsonPrimitive, tuple[AllowableDefaults, ...]]"
)


JsonPrimitive = Union[str, int, float, bool, None]
AllowableDefaults = TypeAliasType(
Expand Down
7 changes: 4 additions & 3 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def test_input_node_valid_values(self):
"string",
True,
None,
[1, 2],
[["recursive", "tuple"], [True, False]],
(1, 2),
(("recursive", "tuple"), (True, False)),
)
for value in good_values:
with self.subTest(value=value):
Expand All @@ -73,9 +73,10 @@ def test_input_node_valid_values(self):
).value
)


def test_input_node_invalid_value_raises(self):
bad_values = (
{1: 2},
{"mutable": "thing"},
_NoTrivialSerialization(),
)
for value in bad_values:
Expand Down
Loading