Skip to content

fix(plugin-import-export): pre-scan columns before streaming CSV export - #13009

Merged
PatrikKozak merged 3 commits into
mainfrom
fix/export-dynamic-columns-stream
Jul 3, 2025
Merged

PatrikKozak merged 3 commits into
mainfrom
fix/export-dynamic-columns-stream

Conversation

@PatrikKozak

@PatrikKozak PatrikKozak commented Jul 1, 2025 •

Copy link
Copy Markdown
Contributor

What?

Fixes an issue where only the fields from the first batch of documents were used to generate CSV column headers during streaming exports.

Why?

Previously, columns were determined during the first streaming batch. If a field appeared only in later documents, it was omitted from the CSV entirely — leading to incomplete exports when fields were sparsely populated across the dataset.

How?

  • Adds a pre-scan step before streaming begins to collect all column keys across all pages
  • Uses this superset of keys to define the final CSV header
  • Ensures every row is padded to match the full column set

This matches the behavior of non-streamed exports and guarantees that the streamed CSV output includes all relevant fields, regardless of when they appear in pagination.

DanRibbens
DanRibbens previously approved these changes Jul 1, 2025
@PatrikKozak PatrikKozak changed the title fix(plugin-import-export): dynamically generate CSV columns during streaming export fix(plugin-import-export): pre-scan columns before streaming CSV export Jul 2, 2025
@PatrikKozak
PatrikKozak enabled auto-merge (squash) July 3, 2025 12:47
@PatrikKozak
PatrikKozak merged commit 34c3a51 into main Jul 3, 2025
@PatrikKozak
PatrikKozak deleted the fix/export-dynamic-columns-stream branch July 3, 2025 12:53
@github-actions

github-actions Bot commented Jul 3, 2025

Copy link
Copy Markdown
Contributor

🚀 This is included in version v3.45.0

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants