Conversation
8c71bef to
4b05a16
Compare
This reverts commit d7bd284.
…le, even if the estimation could be improved
0f189a9 to
d187b2a
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the CSV caching and row estimation logic to improve how row numbers are assigned, particularly for rows at the end of files. The changes separate estimation concerns from caching by introducing a new Estimator class and restructuring the CSVCache to focus purely on storage.
Key Changes:
- Introduced a new
Estimatorclass to handle row number estimation separately from caching - Refactored
CSVCacheto remove internal row tracking (firstRow) and event emission, simplifying its responsibility to pure data storage - Updated the fetch logic to use byte-offset-based estimation rather than row-number-based positioning
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test/dataframe.test.ts | Updated tests to reflect new estimation behavior where out-of-bound fetches no longer throw and estimated row numbers are returned even for uncached rows |
| test/cache.test.ts | Restructured tests to cover the new RowsCache and Estimator classes, removing tests for the old row-tracking approach |
| src/helpers.ts | Added checkInteger function for validating integer values without the non-negative constraint |
| src/dataframe.ts | Integrated Estimator class, refactored fetch logic to use byte offset estimation, and updated event handling to refresh estimates explicitly |
| src/cache.ts | Major refactoring: introduced RowsCache and Estimator classes, removed firstRow tracking from CSVRange, simplified CSVCache to focus on storage operations |
| package.json | Updated baseline-browser-mapping dependency from 2.8.12 to 2.9.5 |
| package-lock.json | Lockfile update for the dependency version change |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
This was referenced Dec 11, 2025
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Big refactoring, aiming at simplifying the concepts and the code, and having more predictability.
Improvements: