bito-code-review[bot] commented on code in PR #44604:
URL: https://github.com/apache/superset/pull/44604#discussion_r4139728216


##########
superset/db_engine_specs/bigquery.py:
##########
@@ -465,13 +465,17 @@ def fetch_data(cls, cursor: Any, limit: int | None = 
None) -> list[tuple[Any, ..
 
             # First batch already covers the budget or the result set
             if rows_fetched < initial_batch_size or remaining_rows <= 0:
+                # A full sample can also be the entire result. Confirm an 
omitted
+                # row; a bounded cursor leaves its own EOF probe to the 
executor.
                 memory_limited = (
-                    remaining_rows <= 0 and rows_fetched == initial_batch_size
+                    remaining_rows <= 0
+                    and rows_fetched == initial_batch_size
+                    and bool(cursor.fetchmany(1))

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>EOF probe drops row</b></div>
   <div id="fix">
   
   The new EOF probe `cursor.fetchmany(1)` consumes a row from the cursor, but 
this branch returns only `first_batch` (line 478) — `FetchedRows` 
(superset_typing.py:165) is a plain list with no cursor back-reference, so the 
probed row is silently dropped whenever a full first sample exactly exhausts 
the budget. Capture the probe result and append the row to `first_batch` when 
non-empty before returning.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #021104</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to