dabla commented on code in PR #62922:
URL: https://github.com/apache/airflow/pull/62922#discussion_r4232825080
##########
task-sdk/src/airflow/sdk/bases/operator.py:
##########
@@ -1075,6 +1077,7 @@ def __init__(
inlets: Any | None = None,
outlets: Any | None = None,
task_group: TaskGroup | None = None,
+ task_concurrency: int | None = None,
Review Comment:
The name stays. `task_concurrency` was the Airflow 2 name for a per-task
concurrency limit, and that is what it is again here, scoped to the one place
it has a meaning: how many iterations of an iterated task run at once. I did
not want to invent a second name for the same idea.
Misuse is not possible: `.partial()` and `@task` keep the value only for
`.iterate()` / `.iterate_kwargs()`, and every other path raises `TypeError`
with the reason (direct construction, `.expand()`, `.expand_kwargs()`), while
`default_args` do not set it, as they did not before, so a Dag that still
carries the Airflow 2 option there is unaffected. Code ported from Airflow 2
cannot hit the new meaning without being rewritten to `.iterate()`, which did
not exist. The `BaseOperator` docstring says all of this next to the parameter.
Drafted-by: Claude Fable 5.1; reviewed by @dabla before posting
--
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]