Skip to content

fix: include all FSE records in compliance report export (#4619)#4635

Open
AlexZorkin wants to merge 1 commit into
developfrom
fix/alex-fse-download-limit-4619
Open

fix: include all FSE records in compliance report export (#4619)#4635
AlexZorkin wants to merge 1 commit into
developfrom
fix/alex-fse-download-limit-4619

Conversation

@AlexZorkin

Copy link
Copy Markdown
Collaborator

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.py fetched FSE records via get_fse_reporting_list_paginated with a hardcoded size=1000, so only the first page was ever included. (The supplier/BCeID path already fetched all rows via get_effective_fse_reporting_rows_for_export, so only the government export was affected.)

Fix

  • Fetch the first page to learn the true total (which the paginated query already returns).
  • Re-fetch with size=total only when the report has more rows than the initial page, so nothing is capped.
  • Uses the query's own count, so it stays self-consistent, and the second fetch happens only when truncation would actually occur.

Verification

  • Backend syntax-checked.
  • Not exercised against a live stack (requires the backend running plus a report with >1,000 FSE records); verified by inspection.

Files

  • backend/lcfs/web/api/compliance_report/sheet_exporters/fse.py

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.
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Frontend Test Results

    1 files    350 suites   3m 54s ⏱️
5 729 tests 5 711 ✅ 18 💤 0 ❌
5 739 runs  5 721 ✅ 18 💤 0 ❌

Results for commit 8b89f3d.

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Backend Test Results

2 299 tests   2 298 ✅  18m 16s ⏱️
   44 suites      1 💤
    1 files        0 ❌

Results for commit 8b89f3d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LCFS - FSE download limit in CR

1 participant