jason810496 opened a new pull request, #69503:
URL: https://github.com/apache/airflow/pull/69503

   - #63531
   
   ## Why
   
   `FileTaskHandler.read()` raises `TypeError: Invalid log stream type... Got 
islice instead` whenever a client polls/tails the logs of a running task (any 
read after the first, i.e. `metadata["log_pos"]` is set) — a regression from 
#63531 in released Airflow 3.2.2.
   
   - #63531 fixed `_read()` to correctly reassign `out_stream = 
islice(out_stream, metadata["log_pos"], None)`, but that changed `out_stream`'s 
runtime type from `GeneratorType` to `itertools.islice`.
   - The public `read()` wrapper dispatches on `_is_logs_stream_like()`, which 
only recognized `chain`/`GeneratorType` — not `islice` — so it fell through 
every branch and raised `TypeError`.
   
   ## What
   
   - Add `islice` to `_is_logs_stream_like`'s `isinstance` tuple.
   - But not using `Iterator` with `isinstance` as the purpose of 
`_is_logs_stream_like` is distinguishing whether the given "iterator" log 
source is coming "from stream interface" or not, `Iterator` is too board.
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes, with help of Claude Code Sonnet 5 following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


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