kaxil commented on code in PR #44579:
URL: https://github.com/apache/airflow/pull/44579#discussion_r1866510146
##########
task_sdk/src/airflow/sdk/execution_time/supervisor.py:
##########
@@ -694,11 +684,7 @@ def cb(sock: socket):
# We could have read multiple lines in one go, yield them all
while (newline_pos := buffer.find(b"\n")) != -1:
- if TYPE_CHECKING:
- # We send in a memoryvuew, but pretend it's a bytes, as Buffer
is only in 3.12+
- line = buffer[: newline_pos + 1]
- else:
- line = memoryview(buffer)[: newline_pos + 1] # Include the
newline character
Review Comment:
```py
(Pdbr) line
<memory at 0xffff88873100>
(Pdbr) bytes(line)
b'{"state":"deferred","classpath":"airflow.providers.standard.triggers.temporal.DateTimeTrigger","trigger_kwargs":{"moment":"2024-11-07T12:34:59Z","end_from_trigger":false},"next_method":"execute_complete","trigger
_timeout":null,"type":"DeferTask"}\n'
(Pdbr) decoder.validate_json(line)
*** pydantic_core._pydantic_core.ValidationError: 1 validation error for
tagged-union[TaskState,GetXCom,GetConnection,GetVariable,DeferTask]
JSON input should be string, bytes or bytearray
For further information visit
https://errors.pydantic.dev/2.10/v/json_type
(Pdbr) decoder.validate_json(bytes(line))
DeferTask(state='deferred',
classpath='airflow.providers.standard.triggers.temporal.DateTimeTrigger',
trigger_kwargs={'moment': '2024-11-07T12:34:59Z', 'end_from_trigger': False},
next_method='execute_complete',
trigger_timeout=None, type='DeferTask')
```
--
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]