Fix: Batch processing now loads all rows from file instead of being limited to 200#20
Merged
Merged
Conversation
Co-authored-by: tmaier-kettering <109093855+tmaier-kettering@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue with batch request size in file processing
Fix: Batch processing now loads all rows from file instead of being limited to 200
Oct 22, 2025
tmaier-kettering
approved these changes
Oct 22, 2025
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.
Problem
When users imported files with 2,500+ rows for batch processing (single label classification, multi-label classification, or keyword extraction), only 200 batch requests were being sent to the OpenAI API instead of the full dataset. This significantly limited the utility of the batch processing features for large datasets.
Root Cause
The issue was in the
import_data()function infile_handling/data_import.py. The function has two phases:_refresh_preview()loads only the first 200 rows for UI performance and caches them in_loaded_rows_do_import()was reusing the cached_loaded_rowsinstead of reloading the full fileThis meant that even though the file contained thousands of rows, only the 200 preview rows were actually imported and used for batch processing.
Solution
Modified
_do_import()to always reload the full file without themax_rowslimit, regardless of whether preview data exists in the cache. This ensures:Before:
After:
Testing
Validated with files containing 50, 200, 201, 300, 2,500, and 5,000 rows:
Impact
This fix affects all features that use
import_data():Users can now process datasets of any size without artificial limitations.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.