@@ -593,7 +593,7 @@ def split(
593
593
a reference to the task
594
594
"""
595
595
if self ._lzout :
596
- raise Exception (
596
+ raise RuntimeError (
597
597
f"Cannot split { self } as its output interface has already been accessed"
598
598
)
599
599
if splitter is None and inputs :
@@ -737,7 +737,6 @@ def _extract_input_el(self, inputs, inp_nm, ind):
737
737
738
738
def get_input_el (self , ind ):
739
739
"""Collect all inputs required to run the node (for specific state element)."""
740
- assert ind is not None
741
740
# TODO: doesn't work properly for more cmplicated wf (check if still an issue)
742
741
input_ind = self .state .inputs_ind [ind ]
743
742
inputs_dict = {}
@@ -921,10 +920,9 @@ def _sanitize_spec(
921
920
Parameters
922
921
----------
923
922
spec : SpecInfo or List[str] or Dict[str, type]
924
- Input specification to be sanitized.
923
+ Specification to be sanitized.
925
924
wf_name : str
926
925
The name of the workflow for which the input specifications
927
- are sanitized.
928
926
spec_name : str
929
927
name given to generated SpecInfo object
930
928
@@ -941,11 +939,10 @@ def _sanitize_spec(
941
939
graph_checksum_input = ("_graph_checksums" , ty .Any )
942
940
if spec :
943
941
if isinstance (spec , SpecInfo ):
944
- if not any ([ x == BaseSpec for x in spec .bases ]) :
945
- raise ValueError ("Provided SpecInfo must have BaseSpec as it's base." )
942
+ if BaseSpec not in spec .bases :
943
+ raise ValueError ("Provided SpecInfo must have BaseSpec as its base." )
946
944
if "_graph_checksums" not in {f [0 ] for f in spec .fields }:
947
945
spec .fields .insert (0 , graph_checksum_input )
948
- return spec
949
946
else :
950
947
base = BaseSpec
951
948
if isinstance (spec , list ):
@@ -998,9 +995,7 @@ def __init__(
998
995
messenger_args = None ,
999
996
messengers = None ,
1000
997
output_spec : ty .Optional [
1001
- ty .Union [
1002
- ty .List [ty .Text ], ty .Dict [ty .Text , ty .Type [ty .Any ]], SpecInfo , BaseSpec
1003
- ]
998
+ ty .Union [ty .List [str ], ty .Dict [str , type ], SpecInfo , BaseSpec ]
1004
999
] = None ,
1005
1000
rerun = False ,
1006
1001
propagate_rerun = True ,
0 commit comments