Skip to content

Commit 46705cc

Browse files
committed
HDF5 import: fix return values for labels to ensure consistent string outputs
(and avoid guidata validation warnings)
1 parent 5b2f800 commit 46705cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

datalab/h5/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def fix_ldata(fuzzy):
2020
fuzzy = to_string(fuzzy)
2121
if isinstance(fuzzy, str):
2222
return fuzzy
23-
return None
23+
return ""
2424

2525

2626
def fix_ndata(fuzzy):
@@ -56,15 +56,15 @@ def process_label(dset, name):
5656
try:
5757
ldata = dset[name][()]
5858
if ldata is not None:
59-
xldata, yldata, zldata = None, None, None
59+
xldata, yldata, zldata = "", "", ""
6060
if len(ldata) == 2:
6161
xldata, yldata = ldata
6262
elif len(ldata) == 3:
6363
xldata, yldata, zldata = ldata
6464
return fix_ldata(xldata), fix_ldata(yldata), fix_ldata(zldata)
6565
except KeyError:
6666
pass
67-
return None, None, None
67+
return "", "", ""
6868

6969

7070
def process_xy_values(dset, name):

0 commit comments

Comments
 (0)