o-nikolas commented on code in PR #77279:
URL: https://github.com/apache/airflow/pull/77279#discussion_r4631589136
##########
task-sdk/src/airflow/sdk/bases/operator.py:
##########
@@ -403,6 +403,10 @@ def partial(
partial_kwargs["start_date"] = timezone.convert_to_utc(start_date)
if end_date := partial_kwargs.get("end_date", None):
partial_kwargs["end_date"] = timezone.convert_to_utc(end_date)
+ # The scheduler reads a mapped task's pool only from partial_kwargs,
and the key being
+ # present is what makes expand(pool=...) fail as "unmappable".
+ if partial_kwargs.get("pool") is None:
+ partial_kwargs["pool"] = DEFAULT_POOL_NAME
Review Comment:
Small one: Airflow 2 also defaulted the pool in `_TaskDecorator._expand()`
(`task-sdk/src/airflow/sdk/bases/decorator.py`, around line 686), and the
comment above this block says to keep the two in sync. `@task` can't hit the
`expand(pool=...)` bug since `expand()` maps function args there, but
`my_task.partial(pool=None).expand(...)` still leaves `.pool` as None. Worth
adding the same two lines there?
--
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]