kaxil commented on code in PR #45104:
URL: https://github.com/apache/airflow/pull/45104#discussion_r1893606948
##########
task_sdk/tests/execution_time/test_supervisor.py:
##########
@@ -772,7 +773,7 @@ def watched_subprocess(self, mocker):
),
pytest.param(
GetVariable(key="test_key"),
- b'{"key":"test_key","value":"test_value"}\n',
+
b'{"key":"test_key","value":"test_value","type":"VariableResult"}\n',
Review Comment:
Without this the failure is:
```py
╭─────────────────────────────── Traceback (most recent call last)
────────────────────────────────╮
│ /opt/airflow/task_sdk/src/airflow/sdk/execution_time/task_runner.py:177 in
get_message │
│
│
│ 174 │ │ """
│
│ 175 │ │ line = self.input.readline()
│
│ 176 │ │ try:
│
│ ❱ 177 │ │ │ msg = self.decoder.validate_json(line)
│
│ 178 │ │ except Exception:
│
│ 179 │ │ │
structlog.get_logger(logger_name="CommsDecoder").exception("Unable to decode │
│ 180 │ │ │ raise
│
│
│
│ ╭──────────────────────────────────────── locals
────────────────────────────────────────╮ │
│ │ line = b'{"key":"test_key","value":"test_value"}\n'
│ │
│ │ self = CommsDecoder(input=<_io.BytesIO object at 0xffff96710ef0>,
request_socket=None) │ │
│
╰────────────────────────────────────────────────────────────────────────────────────────╯
│
│
│
│ /usr/local/lib/python3.9/site-packages/pydantic/type_adapter.py:446 in
validate_json │
│
│
│ 443 │ │ Returns:
│
│ 444 │ │ │ The validated object.
│
│ 445 │ │ """
│
│ ❱ 446 │ │ return self.validator.validate_json(
│
│ 447 │ │ │ data, strict=strict, context=context,
allow_partial=experimental_allow_parti │
│ 448 │ │ )
│
│ 449
│
│
│
│ ╭─────────────────────────────────────────── locals
───────────────────────────────────────────╮ │
│ │ context = None
│ │
│ │ data =
b'{"key":"test_key","value":"test_value"}\n' │ │
│ │ experimental_allow_partial = False
│ │
│ │ self =
TypeAdapter(Annotated[Union[airflow.sdk.execution_time.comms.S… │ │
│ │
airflow.sdk.execution_time.comms.XComResult, │ │
│ │
airflow.sdk.execution_time.comms.ConnectionResult, │ │
│ │
airflow.sdk.execution_time.comms.VariableResult, │ │
│ │
airflow.sdk.execution_time.comms.ErrorResponse], │ │
│ │ FieldInfo(annotation=NoneType,
required=True, │ │
│ │ discriminator='type')])
│ │
│ │ strict = None
│ │
│
╰──────────────────────────────────────────────────────────────────────────────────────────────╯
│
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValidationError: 1 validation error for
tagged-union[StartupDetails,XComResult,ConnectionResult,VariableResult,ErrorResponse]
Unable to extract tag using discriminator 'type'
[type=union_tag_not_found, input_value={'key':
'test_key', 'value': 'test_value'}, input_type=dict]
For further information visit
https://errors.pydantic.dev/2.10/v/union_tag_not_found
```
--
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]