Skip to content

Commit 58e35a5

Browse files
committed
only keep values in schema and ignore the rest
1 parent e83eda3 commit 58e35a5

File tree

1 file changed

+3
-1
lines changed
  • packages/dask-task-models-library/src/dask_task_models_library/container_tasks

1 file changed

+3
-1
lines changed

packages/dask-task-models-library/src/dask_task_models_library/container_tasks/io.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ def from_task_output(
195195
with suppress(json.JSONDecodeError):
196196
# NOTE: The suppression here is ok, since if the data is empty,
197197
# there will be a validation error anyway
198-
data = json_loads(output_data_file.read_text())
198+
loaded_data = json_loads(output_data_file.read_text())
199+
# ignore what is not in the schema
200+
data = {k: v for k, v in loaded_data.items() if k in schema}
199201

200202
for output_key, output_params in schema.items():
201203
if isinstance(output_params, FilePortSchema):

0 commit comments

Comments
 (0)