Skip to content

Display row numbers with errors #285

@ppurang

Description

@ppurang

Recently, while consuming a csv file and using readLabelled ran into .. Failed to decode XYZ: Received Field $field. This error report is partially helpful, as given a long enough CSV file this amounts to the proverbial - looking for a needle in a hay stack. It would be great if we could get something like (just a suggestion):

Row 256*. Failed to decode XYZ: Received Field $field

where 256* is the row at which the error was encountered - with or without the header column (?)

But this feature might not be that convenient for performance reasons (multi gigabyte files, lot of rows etc.) so it might need to be an opt-in feature.

So,

  1. Can this be solved easily by client code right now? Without the need for library support.
  2. If this were to be supported by the library how would that be?

Aside: Does the parser emit line numbers if something errors out?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions