@@ -534,25 +534,25 @@ def wrapper(func):
534534 ** signature_kwargs ,
535535 )
536536 if input_types is not None :
537- if _utils .has_input_type (py_sig ):
538- msg = bfe .format_message (
539- "Redundant or conflicting input types detected, using the one from the decorator."
540- )
541- warnings .warn (msg , category = bfe .FunctionRedundantTypeHintWarning )
542537 if not isinstance (input_types , collections .abc .Sequence ):
543538 input_types = [input_types ]
539+ if _utils .has_conflict_input_type (py_sig , input_types ):
540+ msg = bfe .format_message (
541+ "Conflicting input types detected, using the one from the decorator."
542+ )
543+ warnings .warn (msg , category = bfe .FunctionConflictTypeHintWarning )
544544 py_sig = py_sig .replace (
545545 parameters = [
546546 par .replace (annotation = itype )
547547 for par , itype in zip (py_sig .parameters .values (), input_types )
548548 ]
549549 )
550550 if output_type :
551- if _utils .has_output_type (py_sig ):
551+ if _utils .has_conflict_output_type (py_sig , output_type ):
552552 msg = bfe .format_message (
553- "Redundant or conflicting return type detected, using the one from the decorator."
553+ "Conflicting return type detected, using the one from the decorator."
554554 )
555- warnings .warn (msg , category = bfe .FunctionRedundantTypeHintWarning )
555+ warnings .warn (msg , category = bfe .FunctionConflictTypeHintWarning )
556556 py_sig = py_sig .replace (return_annotation = output_type )
557557
558558 # Try to get input types via type annotations.
@@ -846,25 +846,25 @@ def wrapper(func):
846846 ** signature_kwargs ,
847847 )
848848 if input_types is not None :
849- if _utils .has_input_type (py_sig ):
850- msg = bfe .format_message (
851- "Redundant or conflicting input types detected, using the one from the decorator."
852- )
853- warnings .warn (msg , category = bfe .FunctionRedundantTypeHintWarning )
854849 if not isinstance (input_types , collections .abc .Sequence ):
855850 input_types = [input_types ]
851+ if _utils .has_conflict_input_type (py_sig , input_types ):
852+ msg = bfe .format_message (
853+ "Conflicting input types detected, using the one from the decorator."
854+ )
855+ warnings .warn (msg , category = bfe .FunctionConflictTypeHintWarning )
856856 py_sig = py_sig .replace (
857857 parameters = [
858858 par .replace (annotation = itype )
859859 for par , itype in zip (py_sig .parameters .values (), input_types )
860860 ]
861861 )
862862 if output_type :
863- if _utils .has_output_type (py_sig ):
863+ if _utils .has_conflict_output_type (py_sig , output_type ):
864864 msg = bfe .format_message (
865- "Redundant or conflicting return type detected, using the one from the decorator."
865+ "Conflicting return type detected, using the one from the decorator."
866866 )
867- warnings .warn (msg , category = bfe .FunctionRedundantTypeHintWarning )
867+ warnings .warn (msg , category = bfe .FunctionConflictTypeHintWarning )
868868 py_sig = py_sig .replace (return_annotation = output_type )
869869
870870 udf_sig = udf_def .UdfSignature .from_py_signature (py_sig )
0 commit comments