Skip to content

CsvReader is consumed after extracting DataFrame #38

@AuPath

Description

@AuPath

The CSVReader consumes its input when creating a DataFrame, which means that after processing, the data is no longer available for further use. As a result, mappings like the following lead to an error because $df2 contains no rows. This issue occurs because the NamedCsvReader class from the FastCSV library is stream-based, meaning it can only be consumed once and does not retain the data after it's been read. This specific class has been removed in recent versions of the fastcsv library (https://fastcsv.org/guides/upgrade_2/#namedcsvreader-removedreplaced).

Csv input:

a,b,c
1,2,3

Mapping:

#set ($df1 = $readers.reader1.getDataframe())
#set ($df2 = $reader.getDataframe())
$df1[0].a,$df1[0].b,$df1[0].c,$df2[0].a,$df2[0].b,$df2[0].c

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions