Skip to content

Commit f0945d2

Browse files
committed
fix: redefine NestedDict
fix: decode string for HDF5Dataset Signed-off-by: zjgemi <liuxin_zijian@163.com>
1 parent 28e855a commit f0945d2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/dflow/python/opio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
from ..io import PVC, type_to_str
1010

1111

12-
class NestedDict:
12+
class NestedDictBase:
1313
pass
1414

1515

16-
class NestedDictStr(NestedDict):
16+
class NestedDictStr(NestedDictBase):
1717
pass
1818

1919

20-
class NestedDictPath(NestedDict):
20+
class NestedDictPath(NestedDictBase):
2121
pass
2222

2323

src/dflow/python/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ def handle_output_artifact(name, value, sign, slices=None, data_root="/tmp",
233233
else:
234234
d = f.create_dataset(s, data=v)
235235
d.attrs["type"] = "data"
236+
if isinstance(v, str):
237+
d.attrs["dtype"] = "utf-8"
236238
path_list.append({"dflow_list_item": h5_name, "order": slices or 0})
237239
if sign.type in [str, Path]:
238240
os.makedirs(data_root + '/outputs/artifacts/' + name, exist_ok=True)

0 commit comments

Comments
 (0)