@@ -580,11 +580,15 @@ def setup_module(
580580 raise ValueError ("Invalid format for attributes: %s" % attribute_string )
581581 # Fix for array dtypes which contain split separator
582582 attribute_string = attribute_string .replace ("dtype='|S" , "dtype='S" )
583- # 4674- sometimes notes have pipes
584- prenote ,note ,postnote = re .split ("(?P<note>\|notes:\[.*?\]\|)" ,attribute_string )
585- attribute_strings = prenote [1 :].split ("|" )
586- attribute_strings += [note [1 :- 1 ]]
587- attribute_strings += postnote [:- 1 ].split ("|" )
583+ if len (re .split ("(?P<note>\|notes:\[.*?\]\|)" ,attribute_string )) == 3 :
584+ # 4674- sometimes notes have pipes
585+ prenote ,note ,postnote = re .split ("(?P<note>\|notes:\[.*?\]\|)" ,attribute_string )
586+ attribute_strings = prenote [1 :].split ("|" )
587+ attribute_strings += [note [1 :- 1 ]]
588+ attribute_strings += postnote [:- 1 ].split ("|" )
589+ else :
590+ #old or weird pipeline without notes
591+ attribute_strings = attribute_string [1 :- 1 ].split ("|" )
588592 variable_revision_number = None
589593 # make batch_state decodable from text pipelines
590594 # NOTE, MAGIC HERE: These variables are **necessary**, even though they
0 commit comments