Skip to content

Conversation

@yehorkardash
Copy link
Contributor

Summary

This PR adds a new parameter that allows skipping records with errors when parsing csv files

image

It also fixes a bug, which made the node ignore errors when parsing binary data from buffer. It is a breaking behavior, so it's enabled only for new versions

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/NODE-3690/extract-from-file-strict-csv-parsing-causing-full-file-failure

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@n8n-assistant n8n-assistant bot added n8n team Authored by the n8n team node/improvement New feature or request labels Oct 29, 2025
@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ase/nodes/SpreadsheetFile/v2/fromFile.operation.ts 63.15% 6 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 5 files

Prompt for AI agents (all 2 issues)

Understand the root cause of the following 2 issues and fix them.


<file name="packages/nodes-base/nodes/SpreadsheetFile/v2/fromFile.operation.ts">

<violation number="1" location="packages/nodes-base/nodes/SpreadsheetFile/v2/fromFile.operation.ts:123">
`columns` needs to stay truthy by default; otherwise csv-parse stops mapping rows to object keys when the user leaves Header Row at its default. Please keep the prior `!== false` guard so the first row is still treated as headers unless the option is explicitly disabled.</violation>

<violation number="2" location="packages/nodes-base/nodes/SpreadsheetFile/v2/fromFile.operation.ts:170">
A user setting Max Skipped Records to 0 expects any skipped row to trigger an error, but the `&gt; 0` guard skips that case. Treat all non-negative limits as active so 0 works as the strictest setting.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

}

const maxSkippedRecords = options.skipRecordsWithErrors?.value?.maxSkippedRecords ?? -1;
if (skipRecordsWithErrors && maxSkippedRecords > 0 && skippedRecords > maxSkippedRecords) {
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A user setting Max Skipped Records to 0 expects any skipped row to trigger an error, but the > 0 guard skips that case. Treat all non-negative limits as active so 0 works as the strictest setting.

Prompt for AI agents
Address the following comment on packages/nodes-base/nodes/SpreadsheetFile/v2/fromFile.operation.ts at line 170:

<comment>A user setting Max Skipped Records to 0 expects any skipped row to trigger an error, but the `&gt; 0` guard skips that case. Treat all non-negative limits as active so 0 works as the strictest setting.</comment>

<file context>
@@ -118,7 +151,26 @@ export async function execute(
+				}
+
+				const maxSkippedRecords = options.skipRecordsWithErrors?.value?.maxSkippedRecords ?? -1;
+				if (skipRecordsWithErrors &amp;&amp; maxSkippedRecords &gt; 0 &amp;&amp; skippedRecords &gt; maxSkippedRecords) {
+					throw new NodeOperationError(this.getNode(), &#39;Max number of skipped records exceeded&#39;, {
+						itemIndex: i,
</file context>
Suggested change
if (skipRecordsWithErrors && maxSkippedRecords > 0 && skippedRecords > maxSkippedRecords) {
if (skipRecordsWithErrors && maxSkippedRecords >= 0 && skippedRecords > maxSkippedRecords) {
Fix with Cubic

yehorkardash and others added 2 commits October 29, 2025 17:42
…n.ts

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
@blacksmith-sh
Copy link

blacksmith-sh bot commented Oct 29, 2025

✅ All jobs passed

Summary: 2 successful workflows

Last updated: 2025-10-29 16:07:07 UTC

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

Labels

n8n team Authored by the n8n team node/improvement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants