nathadfield commented on code in PR #67285:
URL: https://github.com/apache/airflow/pull/67285#discussion_r3426529553
##########
airflow-core/src/airflow/api_fastapi/execution_api/versions/v2026_06_30.py:
##########
@@ -127,3 +127,17 @@ class AddTaskAndAssetStateStoreEndpoints(VersionChange):
endpoint("/store/asset/by-uri/value", ["DELETE"]).didnt_exist,
endpoint("/store/asset/by-uri/clear", ["DELETE"]).didnt_exist,
)
+
+
+class AddPartitionDateField(VersionChange):
+ """Expose the consumer DagRun's partition datetime on the execution API so
consumer tasks can template it."""
+
+ description = __doc__
+
+ instructions_to_migrate_to_previous_version =
(schema(DagRun).field("partition_date").didnt_exist,)
+
+ @convert_response_to_previous_version_for(TIRunContext) # type:
ignore[arg-type]
+ def remove_partition_date_from_dag_run(response: ResponseInfo) -> None: #
type: ignore[misc]
+ """Strip ``partition_date`` from the nested ``dag_run`` payload for
older clients."""
+ if "dag_run" in response.body and isinstance(response.body["dag_run"],
dict):
+ response.body["dag_run"].pop("partition_date", None)
Review Comment:
@uranusjr No, it doesn't in this case, unfortunately. If I drop the
converter and keep only the instruction, the downgrade test fails with:
```
{'type': 'extra_forbidden', 'loc': ('response', 'dag_run',
'partition_date'), 'msg': 'Extra inputs are not permitted'}
```
So the converter pops it from the body to make the downgrade work. Same
reason `AddTeamNameField` just above carries an equivalent
`remove_team_name_field` converter for the nested DagRun.
--
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]