dabla commented on code in PR #62922:
URL: https://github.com/apache/airflow/pull/62922#discussion_r4761362688


##########
task-sdk/src/airflow/sdk/execution_time/schema/versions/v2027_02_28.py:
##########
@@ -107,3 +107,19 @@ def report_as_a_generic_error(response: ResponseInfo = 
None) -> None:  # type: i
         """Report the failure as a generic one to a runtime whose version has 
no type for it."""
         if response.body.get("error") == ErrorType.XCOM_BACKEND_ERROR.value:
             response.body["error"] = ErrorType.GENERIC_ERROR.value
+
+
+class AddRegionToGetXCom(VersionChange):

Review Comment:
   Partly confirmed. Not through the supervisor schema, where requests are only 
upgraded, and not through version negotiation on a server that has this code. 
It does happen with an API server binary older than the parameters: it ignores 
them and answers from the reader's own pass with a 200. The client is the one 
place that sees both the region and the version the server matched (the 
`Airflow-API-Version` response header), so it now raises when a region was sent 
and that version is older than `2027-02-28`, naming the version and what to 
upgrade. It checks on a 200 and on the two refusals such a server gives for a 
reader outside the region (400 and 404); any other error is raised as it is. 
That is a new hard failure for a worker upgraded before its API server, so the 
docs page has a short section on it. Fixed in the latest push.
   



##########
airflow-core/src/airflow/api_fastapi/execution_api/versions/v2027_02_28.py:
##########
@@ -121,3 +121,14 @@ class 
ResolveOmittedXComMapIndexByTaskDefinition(VersionChangeWithSideEffects):
     instructions_to_migrate_to_previous_version = (
         schema(GetXcomFilterParams).field("map_index").had(type=int, 
default=-1),
     )
+
+
+class AddRegionToXComFilterParams(VersionChange):

Review Comment:
   Added, with one thing to know: the version change only takes the two 
parameters out of the previous version's schema. A request of the previous 
version that sends them anyway is still checked like one of this version, not 
answered from another region. So there are two tests: the published schema of 
`2026-12-01` lacks the parameters and `2027-02-28` has them, and a request with 
the `2026-12-01` header that names a region is answered as on this version. If 
you'd rather have the parameters ignored below `2027-02-28`, I can gate them, 
but ignoring them is what gives the wrong pass. Fixed in the latest push.
   



##########
airflow-core/newsfragments/62922.feature.rst:
##########
@@ -0,0 +1 @@
+Task Iteration (AIP-104): ``.iterate()`` and ``.iterate_kwargs()`` on 
operators and ``@task`` run the mapped inputs inside one task instance, 
``task_concurrency`` of them at a time, instead of one task instance per item 
as ``.expand()`` does. Each iteration's result is checkpointed in the task 
state store, so a retry resumes where the previous attempt stopped, and the 
task's return value is an ``XComIterable``, a lazy sequence downstream tasks 
index, iterate or ``.expand()`` over. The Task SDK docs page "Mapped tasks vs 
iterable tasks" says when to use which.

Review Comment:
   Removed. Fixed in the latest push.
   



-- 
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]

Reply via email to