@@ -55,20 +55,20 @@ class NativeStepType(str, Enum):
5555
5656
5757def _discriminate_creator (v : Any ) -> str :
58- disc_map = {"Person" : "NativeCreatorPerson" , "Organization" : "NativeCreatorOrganization" }
58+ disc_map : dict [ str , str ] = {"Person" : "NativeCreatorPerson" , "Organization" : "NativeCreatorOrganization" }
5959 if isinstance (v , dict ):
60- disc_val = v .get ("class" )
60+ disc_val : str = str ( v .get ("class" , "" ) )
6161 else :
62- disc_val = getattr (v , "class" , None )
62+ disc_val = str ( getattr (v , "class" , "" ) )
6363 return disc_map .get (disc_val , disc_val )
6464
6565
6666def _discriminate_comments (v : Any ) -> str :
67- disc_map = {"text" : "NativeTextComment" , "markdown" : "NativeMarkdownComment" , "frame" : "NativeFrameComment" , "freehand" : "NativeFreehandComment" }
67+ disc_map : dict [ str , str ] = {"text" : "NativeTextComment" , "markdown" : "NativeMarkdownComment" , "frame" : "NativeFrameComment" , "freehand" : "NativeFreehandComment" }
6868 if isinstance (v , dict ):
69- disc_val = v .get ("type" )
69+ disc_val : str = str ( v .get ("type" , "" ) )
7070 else :
71- disc_val = getattr (v , "type" , None )
71+ disc_val = str ( getattr (v , "type" , "" ) )
7272 return disc_map .get (disc_val , disc_val )
7373
7474
@@ -452,6 +452,6 @@ def load_document(path: str | Path) -> NativeGalaxyWorkflow | list[NativeGalaxyW
452452 return _load_single (data )
453453
454454
455- def _load_single (data : dict [str , Any ]) -> NativeGalaxyWorkflow | list [ NativeGalaxyWorkflow ] :
455+ def _load_single (data : dict [str , Any ]) -> NativeGalaxyWorkflow :
456456 """Load a single document dict."""
457457 return NativeGalaxyWorkflow .model_validate (data )
0 commit comments