Skip to content
Merged
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
1 change: 1 addition & 0 deletions python/ray/workflow/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def run(entry_workflow: Workflow,
raise ValueError("metadata values must be JSON serializable, "
"however '{}' has a value whose {}.".format(
k, e))
metadata = metadata or {}

store = get_global_storage()
assert ray.is_initialized()
Expand Down
19 changes: 19 additions & 0 deletions python/ray/workflow/tests/test_metadata_put.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,25 @@ def simple():
assert "end_time" in postrun_meta


def test_no_user_metadata(workflow_start_regular):

workflow_id = "simple"
step_name = "simple_step"

@workflow.step(name=step_name)
def simple():
return 0

simple.step().run(workflow_id)

checkpointed_user_step_metadata = get_metadata(
[workflow_id, "steps", step_name, workflow_storage.STEP_USER_METADATA])
checkpointed_user_run_metadata = get_metadata(
[workflow_id, workflow_storage.WORKFLOW_USER_METADATA])
assert {} == checkpointed_user_step_metadata
assert {} == checkpointed_user_run_metadata


def test_all_metadata(workflow_start_regular):

user_step_metadata = {"k1": "v1"}
Expand Down