Skip to content

Commit 39c5103

Browse files
authored
Merge pull request #443 from dcrescim/read-csv-fix
Fix for readCSV mismatch between Browser and Node
2 parents 0f85cae + f6afd8d commit 39c5103

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/danfojs-base/io/browser/io.csv.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const $readCSV = async (file: any, options?: CsvInputOptionsBrowser): Promise<Da
5252
Papa.parse(file, {
5353
header: true,
5454
dynamicTyping: true,
55+
skipEmptyLines: 'greedy',
5556
...options,
5657
download: true,
5758
complete: results => {

src/danfojs-base/io/node/io.csv.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ const $readCSV = async (filePath: string, options?: CsvInputOptionsNode): Promis
5555
const optionsWithDefaults = {
5656
header: true,
5757
dynamicTyping: true,
58+
skipEmptyLines: 'greedy',
5859
...options,
5960
}
6061

6162
const dataStream = request.get(filePath);
62-
const parseStream: any = Papa.parse(Papa.NODE_STREAM_INPUT, optionsWithDefaults);
63+
const parseStream: any = Papa.parse(Papa.NODE_STREAM_INPUT, optionsWithDefaults as any);
6364
dataStream.pipe(parseStream);
6465

6566
const data: any = [];

0 commit comments

Comments
 (0)