7487 commented on PR #39661:
URL: https://github.com/apache/superset/pull/39661#issuecomment-5451725712

   Good question — dug into it. `manualPagination` is never enabled in this 
plugin, so react-table computes `pageCount = Math.ceil(rows.length / pageSize)` 
from the already-filtered rows. Since `rows` derive from `data`, `data.length 
=== 0` always yields `pageCount === 0`, which the second branch catches and 
resets to page 0 — the `data.length === 0 && pageCount > 0` combination can't 
actually occur, so nothing fell through.
   
   That said, the `data.length > 0` guard was redundant (`pageCount > 0` 
already implies it) and clearly misleading, so 5424bac drops it and adds 
DataTable unit tests covering both branches, including the empty-data case — 
each test fails if its branch is removed.


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