@@ -195,15 +195,15 @@ def build(
195
195
if outputs is None :
196
196
outputs = {}
197
197
198
- jobs = self ._update_nodes_variable_names (_locals )
198
+ jobs : Dict = self ._update_nodes_variable_names (_locals )
199
199
pipeline_component = PipelineComponent (
200
200
name = self .name ,
201
201
version = self .version ,
202
202
display_name = self .display_name ,
203
203
description = self .description ,
204
204
inputs = self .inputs ,
205
205
jobs = jobs ,
206
- tags = self .tags ,
206
+ tags = self .tags , # type: ignore[arg-type]
207
207
source_path = self .source_path ,
208
208
_source = ComponentSource .DSL ,
209
209
)
@@ -276,10 +276,14 @@ def _map_internal_output_type(_meta: Output) -> str:
276
276
"""
277
277
if type (_meta ).__name__ != "InternalOutput" :
278
278
return str (_meta .type )
279
- return str (_meta .map_pipeline_output_type ())
279
+ return str (_meta .map_pipeline_output_type ()) # type: ignore[attr-defined]
280
280
281
281
# Note: Here we set PipelineOutput as Pipeline's output definition as we need output binding.
282
- output_meta = Output (type = _map_internal_output_type (meta ), description = meta .description , mode = meta .mode )
282
+ output_meta = Output (
283
+ type = _map_internal_output_type (meta ), # type: ignore[arg-type]
284
+ description = meta .description ,
285
+ mode = meta .mode ,
286
+ )
283
287
pipeline_output = PipelineOutput (
284
288
port_name = key ,
285
289
data = None ,
@@ -292,9 +296,11 @@ def _map_internal_output_type(_meta: Output) -> str:
292
296
binding_output = value ,
293
297
)
294
298
# copy node level output setting to pipeline output
295
- copy_output_setting (source = value ._owner .outputs [value ._port_name ], target = pipeline_output )
299
+ copy_output_setting (
300
+ source = value ._owner .outputs [value ._port_name ], target = pipeline_output # type: ignore[arg-type]
301
+ )
296
302
297
- value ._owner .outputs [value ._port_name ]._data = pipeline_output
303
+ value ._owner .outputs [value ._port_name ]._data = pipeline_output # type: ignore[union-attr]
298
304
299
305
output_dict [key ] = pipeline_output
300
306
output_meta_dict [key ] = output_meta ._to_dict ()
@@ -383,7 +389,7 @@ def _get_name_or_component_name(node: Union[BaseNode, AutoMLJob]) -> Optional[Un
383
389
f"node name: { name !r} . Duplicate check is case-insensitive."
384
390
)
385
391
local_names .add (name )
386
- id_name_dict [v ._instance_id ] = name
392
+ id_name_dict [v ._instance_id ] = name # type: ignore[union-attr]
387
393
name_count_dict [name ] = 1
388
394
389
395
# Find the last user-defined name for the same type of components
@@ -420,6 +426,7 @@ def _update_inputs(self, pipeline_inputs: Dict[str, Union[PipelineInput, Input,
420
426
:type pipeline_inputs: Dict[str, Union[PipelineInput, Input, NodeOutput, Any]]
421
427
"""
422
428
for input_name , value in pipeline_inputs .items ():
429
+ anno : Any = None
423
430
if input_name not in self .inputs :
424
431
if isinstance (value , PipelineInput ):
425
432
value = value ._data
@@ -497,12 +504,15 @@ def _validate_inferred_outputs(self, output_meta_dict: dict, output_dict: Dict[s
497
504
unmatched_outputs .append (
498
505
f"{ key } : pipeline component output: { actual_output } != annotation output { expected_output } "
499
506
)
507
+ res = output_dict [key ]._meta
500
508
if expected_description :
501
- output_dict [key ]._meta .description = expected_description
509
+ if res is not None :
510
+ res .description = expected_description
502
511
# also copy the description to pipeline job
503
512
output_dict [key ].description = expected_description
504
513
if expected_mode :
505
- output_dict [key ]._meta .mode = expected_mode
514
+ if res is not None :
515
+ res .mode = expected_mode
506
516
# also copy the mode to pipeline job
507
517
output_dict [key ].mode = expected_mode
508
518
@@ -512,7 +522,7 @@ def _validate_inferred_outputs(self, output_meta_dict: dict, output_dict: Dict[s
512
522
@staticmethod
513
523
def _validate_keyword_in_node_io (node : Union [BaseNode , AutoMLJob ]) -> None :
514
524
if has_attr_safe (node , "inputs" ):
515
- for input_name in set (node .inputs ) & COMPONENT_IO_KEYWORDS :
525
+ for input_name in set (node .inputs ) & COMPONENT_IO_KEYWORDS : # type: ignore[arg-type]
516
526
module_logger .warning (
517
527
'Reserved word "%s" is used as input name in node "%s", '
518
528
"can only be accessed with '%s.inputs[\" %s\" ]'" ,
@@ -522,7 +532,7 @@ def _validate_keyword_in_node_io(node: Union[BaseNode, AutoMLJob]) -> None:
522
532
input_name ,
523
533
)
524
534
if has_attr_safe (node , "outputs" ):
525
- for output_name in set (node .outputs ) & COMPONENT_IO_KEYWORDS :
535
+ for output_name in set (node .outputs ) & COMPONENT_IO_KEYWORDS : # type: ignore[arg-type]
526
536
module_logger .warning (
527
537
'Reserved word "%s" is used as output name in node "%s", '
528
538
"can only be accessed with '%s.outputs[\" %s\" ]'" ,
0 commit comments