fix: include all FSE records in compliance report export (#4619)#4635
Open
AlexZorkin wants to merge 1 commit into
Open
fix: include all FSE records in compliance report export (#4619)#4635AlexZorkin wants to merge 1 commit into
AlexZorkin wants to merge 1 commit into
Conversation
The government export path fetched Final Supply Equipment records with a hardcoded pagination size of 1000, so compliance reports with more than 1000 FSE records (e.g. 1300+) were truncated to the first 1000 rows in the downloaded file. Fetch the first page to learn the true total from the paginated query, then re-fetch with size=total when the report has more rows than the initial page. Uses the query's own count so it stays self-consistent, and only performs the second fetch when truncation would occur.
Frontend Test Results 1 files 350 suites 3m 54s ⏱️ Results for commit 8b89f3d. |
Backend Test Results2 299 tests 2 298 ✅ 18m 16s ⏱️ Results for commit 8b89f3d. |
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.
Fixes #4619
Problem
Compliance report downloads were capped at 1,000 Fuel Supply Equipment (FSE) records. Reports with more than 1,000 FSE records (e.g. 1,300+) were silently truncated to the first 1,000 rows in the downloaded file, producing incomplete data.
Cause
The government (IDIR) export path in
sheet_exporters/fse.pyfetched FSE records viaget_fse_reporting_list_paginatedwith a hardcodedsize=1000, so only the first page was ever included. (The supplier/BCeID path already fetched all rows viaget_effective_fse_reporting_rows_for_export, so only the government export was affected.)Fix
total(which the paginated query already returns).size=totalonly when the report has more rows than the initial page, so nothing is capped.Verification
Files
backend/lcfs/web/api/compliance_report/sheet_exporters/fse.py