uranusjr commented on code in PR #76007:
URL: https://github.com/apache/airflow/pull/76007#discussion_r4420914491
##########
task-sdk/tests/task_sdk/execution_time/schema/test_migrator.py:
##########
@@ -561,21 +585,19 @@ def
test_execution_timeout_follows_supervisor_version(self, real_migrator, start
assert context["execution_timeout"] == 90.0
def test_head_version_keeps_arg_bindings(self, real_migrator,
startup_details):
- from airflow.sdk.api.datamodels._generated import LiteralArgBinding,
XComArgBinding
-
out = real_migrator.downgrade(startup_details, "2026-10-30")
assert out.ti_context.arg_bindings is not None
literal, xcom, defaulted = (a.root for a in
out.ti_context.arg_bindings)
- assert isinstance(literal, LiteralArgBinding)
+ assert literal.kind == "literal"
assert literal.value == "uk"
assert literal.name == "country"
assert literal.from_default is False
assert literal.value_schema is None
- assert isinstance(xcom, XComArgBinding)
+ assert xcom.kind == "xcom"
assert xcom.task_id == "extract"
assert xcom.name == "extracted"
assert xcom.value_schema.root == {"type": "object"}
- assert isinstance(defaulted, LiteralArgBinding)
+ assert defaulted.kind == "literal"
assert defaulted.from_default is True
assert defaulted.value_schema.root == {"type": "integer", "format":
"int64"}
Review Comment:
The result is re-validated against Cadwyn’s generated copies of the models
for 2026-10-30 in this test, but since now there are actual migrations
happening, the classes are those copies, not the head ones, so isinstance fails.
Checking the kind discriminator asserts the same thing, which binding
variant this is, without depending on class identity. I kept the target at
2026-10-30 because that’s the version the Java SDK pins, so it’s the downgrade
that matters in practice.
--
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]