PapaParse icon indicating copy to clipboard operation
PapaParse copied to clipboard

renamedHeaders not showing in meta

Open dasveloper opened this issue 2 years ago • 5 comments

Using 5.4.1 (or you can view in the demo page). When setting { header: true } in the config and having duplicate headers in your data, the headers are renamed correctly but the renamedHeaders meta are not being returned. The docs say "Renamed fields with original (or transformed by transformHeader) are stored in ParseResult.meta.renamedHeaders".

Screenshot 2023-09-30 at 9 25 06 AM Screenshot 2023-09-30 at 9 25 22 AM

Code to replicate:

import Papa from "papaparse";

var data = Papa.parse(
  `Column,Column
1-1,1-2
2-1,2-2
3-1,3-2`,
  { header: true }
);

console.log(data);

dasveloper avatar Sep 30 '23 13:09 dasveloper

@dasveloper - thanks for raising this issue. I contributed to this new field. As you might see the latest released version 5.4.1 source code, the code change hasn't been released yet. However, the document has been updated for some reasons.

@mholt @pokoli can you kindly make another release on current master branch so this field renamedHeaders will benefit more people? Also, it will align with the document update.

jchen042 avatar Nov 06 '23 12:11 jchen042

When this gets released, there should be a corresponding pull request to the @types/papaparse package adding this new field: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/papaparse/index.d.ts#L433

wuzzeb avatar Nov 08 '23 20:11 wuzzeb

@mholt @pokoli - circling back to see any updates here. Would appreciate your response. 🙏

jchen042 avatar Dec 28 '23 21:12 jchen042

Sorry to bump this again @jchen042 @mholt @pokoli, but this issue appears to just be waiting on pushing a new release... 😟

@mholt @pokoli can you kindly make another release on current master branch so this field renamedHeaders will benefit more people? Also, it will align with the document update.

pshbot avatar Apr 26 '24 03:04 pshbot