jason810496 commented on code in PR #46827:
URL: https://github.com/apache/airflow/pull/46827#discussion_r1959990074


##########
airflow/api_fastapi/core_api/routes/public/log.py:
##########
@@ -135,12 +135,22 @@ def get_log(
         except TaskNotFound:
             pass
 
-    logs: Any
     if accept == Mimetype.JSON or accept == Mimetype.ANY:  # default
         logs, metadata = task_log_reader.read_log_chunks(ti, try_number, 
metadata)
-        # we must have token here, so we can safely ignore it
-        token = 
URLSafeSerializer(request.app.state.secret_key).dumps(metadata)  # type: 
ignore[assignment]
-        return TaskInstancesLogResponse(continuation_token=token, 
content=str(logs[0])).model_dump()
-    # text/plain. Stream
-    logs = task_log_reader.read_log_stream(ti, try_number, metadata)
-    return Response(media_type=accept, content="".join(list(logs)))
+        encoded_token = None
+        if not metadata.get("end_of_log", False):
+            encoded_token = 
URLSafeSerializer(request.app.state.secret_key).dumps(metadata)
+        return 
TaskInstancesLogResponse.model_construct(continuation_token=encoded_token, 
content=logs)

Review Comment:
   Not a blocker, but I thought we were also planning to move 
`continuation_token` to the header for the `application/json` response.



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