giulio-leone opened a new pull request, #62606:
URL: https://github.com/apache/airflow/pull/62606

   ## Problem
   
   Three files in the Google provider use `.pop(0)` and `.insert(0, ...)` for 
cursor row buffering. Both operations are **O(n)** on Python lists.
   
   ## Solution
   
   Switch to `collections.deque` with `.popleft()` and `.appendleft()` for 
**O(1)** front operations.
   
   ## Changes
   
   | File | Pattern |
   |------|---------|
   | `hooks/bigquery.py` | `BigQueryCursor.buffer` — row fetch buffer |
   | `transfers/presto_to_gcs.py` | `_PrestoHTTPCursorAdapter.rows` — row 
peek/fetch buffer |
   | `transfers/trino_to_gcs.py` | `_TrinoCursorAdapter.rows` — row peek/fetch 
buffer |
   
   All existing `.append()`, truthiness checks, and iteration work identically 
on deque.


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