You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "eumiro (via GitHub)" <gi...@apache.org> on 2023/09/05 18:00:20 UTC
[GitHub] [airflow] eumiro commented on a diff in pull request #33837: Refactor unneeded 'continue' jumps in models
eumiro commented on code in PR #33837:
URL: https://github.com/apache/airflow/pull/33837#discussion_r1316222356
##########
airflow/models/mappedoperator.py:
##########
@@ -97,15 +97,11 @@ def validate_mapping_kwargs(op: type[BaseOperator], func: ValidationSource, valu
continue
for name in param_names:
value = unknown_args.pop(name, NOTSET)
- if func != "expand":
- continue
- if value is NOTSET:
- continue
- if is_mappable(value):
- continue
- type_name = type(value).__name__
- error = f"{op.__name__}.expand() got an unexpected type {type_name!r} for keyword argument {name}"
- raise ValueError(error)
+ if func == "expand" and value is not NOTSET and not is_mappable(value):
Review Comment:
Reduced the code further to more easily spot different exit points.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org