You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Hey team,
I might be missing some core idea, but it feels like the 'Column header mismatch...' reason gets lost in some specific use case. Please, take a look.
Parse options:
{
discardUnmappedColumns: false,
strictColumnHandling: true,
headers: function (headers: HeaderArray): HeaderArray {
// let's say, it makes headers uppercase
}
}
Event subscription:
.on('data-invalid', (row, rowNumber, reason) => {
// I would expect the reason to be populated for the row with columns count less / greater than headers count
// But it's undefined, because the previous function forgot to pass it (check details below)
})
It looks like a small change should fix it:
Instead of
return cb(null, { isValid: false, row: (parsedRow as never) as O });
do
return cb(null, { isValid: false, row: (parsedRow as never) as O, reason: withHeaders.reason });
Parsing or Formatting?
Formatting
Parsing
To Reproduce
Steps to reproduce the behavior:
Example file contents if applicable
header1,header2
test1,test2,test3
test4
Example code to reproduce the issue.
Parse options:
{
discardUnmappedColumns: false,
strictColumnHandling: true,
headers: function (headers: HeaderArray): HeaderArray {
// let's say, it makes headers uppercase
}
}
Event subscription:
.on('data-invalid', (row, rowNumber, reason) => {
// I would expect the reason to be populated for the row with columns count less / greater than headers count
// But it's undefined, because the previous function forgot to pass it (check details below)
})
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: [e.g. MacOS] MacOS
OS Version [e.g. Mojave] BigSur
Node Version [e.g. 10.16.0] 14
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
Hey team,
I might be missing some core idea, but it feels like the 'Column header mismatch...' reason gets lost in some specific use case. Please, take a look.
Parse options:
Event subscription:
It looks like a small change should fix it:
Instead of
do
Parsing or Formatting?
To Reproduce
Steps to reproduce the behavior:
Parse options:
Event subscription:
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: