dabla commented on code in PR #55068:
URL: https://github.com/apache/airflow/pull/55068#discussion_r2499019941
##########
task-sdk/src/airflow/sdk/bases/operator.py:
##########
@@ -1411,6 +1415,15 @@ def _set_xcomargs_dependency(self, field: str, newvalue:
Any) -> None:
return
XComArg.apply_upstream_relationship(self, newvalue)
+ def _validate_start_from_trigger_kwargs(self):
+ if self.start_from_trigger and self.start_trigger_args and
self.start_trigger_args.trigger_kwargs:
+ for name, val in self.start_trigger_args.trigger_kwargs.items():
+ if callable(val):
+ raise AirflowException(
+ f"{self.__class__.__name__} with task_id
'{self.task_id}' has a callable in trigger kwargs named "
+ f"'{name}', which is not allowed when
start_from_trigger is enabled."
Review Comment:
But in case of templated fields, it is possible to define it as a lambda for
example, so you can put Python expression in it which won't get evaluated by
the Dag processor, but lambda's aren't serializable, thus you cannot use it here
--
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]