Skip to content

extra-label message does not include the extra column name it complains about #1771

@nickolay

Description

@nickolay

When I try to validate a CSV file with an extra column, I get a message There is an extra label "" in header at position "2" lacking the actual name.

$ echo "foo,bar">test.csv; uv run frictionless validate --trusted --schema <(echo -e '{"fields": [{"name": "foo"}]}') test.csv
───────────────────────── Dataset ──────────────────────────
               dataset
┏━━━━━━┳━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┓
┃ name ┃ type  ┃ path     ┃ status  ┃
┡━━━━━━╇━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━┩
│ test │ table │ test.csv │ INVALID │
└──────┴───────┴──────────┴─────────┘
────────────────────────── Tables ──────────────────────────
                            test
┏━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Row  ┃ Field ┃ Type        ┃ Message                     ┃
┡━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ None │ 2     │ extra-label │ There is an extra label ""  │
│      │       │             │ in header at position "2"   │
└──────┴───────┴─────────────┴─────────────────────────────┘

The code passes an empty label name to the template string There is an extra label "{label}" in header at position "{fieldNumber}", and the test doesn't check the label.

Is this an oversight or do I misunderstand something?

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