Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving error message when using the outdated csv format #1113

Merged

Conversation

staudtMarius
Copy link
Member

Resolves #1112

@staudtMarius staudtMarius added the enhancement New feature or request label Jul 1, 2024
@staudtMarius staudtMarius self-assigned this Jul 1, 2024
@staudtMarius staudtMarius added the bug Something isn't working label Jul 1, 2024
Copy link
Member

@sebastian-peter sebastian-peter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing error message (The size of the headline does not fit to the size of the resulting fields to attributes mapping.) could also be made more clear. I'd remove the print of fieldsToAttributesKeySet, since it's just going to be headline with a maximum size of the length of fieldVals.

Please also make sure that there are tests for both cases: Too many and too little headline fields.

@sebastian-peter
Copy link
Member

Looking into this again, we might introduce a new bug here if there are multiple headlines with the same (or similar, since they're case-insensitive) names. So it might have been good the way it's been before.

What for sure needs to be fixed is line 172 in the original CsvDataSource, since the headlines array might be shorter than the fieldVals array. Let me prepare my proposal.

@sebastian-peter
Copy link
Member

Well that escalated quickly.
Additional chanegs:

  • CSV row parsing now throws SourceException
  • Duplicate headline detection
  • Adapted test grid format, which was outdated but no-one noticed because exceptions were not thrown

Copy link
Member

@sebastian-peter sebastian-peter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@staudtMarius gave his ok to my changes, merging :)

@sebastian-peter sebastian-peter merged commit 183c129 into dev Nov 26, 2024
3 checks passed
@sebastian-peter sebastian-peter deleted the ms/#1112-confusing-error-message-on-deprecated-input-data branch November 26, 2024 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confusing error message on deprecated input data
2 participants