potiuk commented on code in PR #33837:
URL: https://github.com/apache/airflow/pull/33837#discussion_r1314704364
##########
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:
this condition has too many "not's" . I think previous version was more
readable. I think. Maybe this ? :
```suggestion
if func == "expand" and not (value is NOTSET or
is_mappable(value)) :
```
or even extract it to separate function
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]