Skip to content

BI-1900 - Exp error message improvement: unrecognized column header#296

Merged
mlm483 merged 5 commits intorelease/0.8.1from
feature/BI-1900
Oct 6, 2023
Merged

BI-1900 - Exp error message improvement: unrecognized column header#296
mlm483 merged 5 commits intorelease/0.8.1from
feature/BI-1900

Conversation

@mlm483
Copy link
Contributor

@mlm483 mlm483 commented Oct 2, 2023

Description

Story: https://breedinginsight.atlassian.net/browse/BI-1900

We parse Excel and CSV files into tablesaw Tables. For Excel files, we use Apache POI to parse, do some validation, and then build a Table. For CSV files, we were using tablesaw to read the CSV into a Table directly. While tablesaw does return descriptive error messages, it doesn't give us as fine-grained control over parsing and exception handling as we want. To solve this, I made changes to FileUtil::parseTableFromCsv to

  • read the InputStream into a String,
  • parse the string with apache.commons.CSVParser and do validation, which enables us to return descriptive error messages that we control to the user, and
  • finally build a Table from the String.

Testing

Note: this only applies to Germplasm and Experiment & Observation uploads, Ontology uses a different code path (for now).

New feature:

Try uploading Excel and CSV files with duplicate column names, make sure the error message shown to the user is descriptive.

Regression

Try uploading Excel and CSV files with required column names missing, any other data issues you can think of, and make sure the error message shown to the user is descriptive.

Checklist:

  • I have performed a self-review of my own code
  • I have tested my code and ensured it meets the acceptance criteria of the story
  • I have tested that my code works with both the brapi-java-server and BreedBase
  • I have create/modified unit tests to cover this change
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to documentation
  • I have run TAF: https://github.com/Breeding-Insight/taf/actions/runs/6422962193

@mlm483 mlm483 changed the base branch from develop to release/0.8.1 October 2, 2023 21:29
@mlm483 mlm483 changed the title BI-1900 BI-1900 - Exp error message improvement: unrecognized column header Oct 4, 2023
@mlm483 mlm483 marked this pull request as ready for review October 4, 2023 19:19
@mlm483 mlm483 requested review from a team, davedrp and nickpalladino and removed request for a team October 5, 2023 18:24
@mlm483
Copy link
Contributor Author

mlm483 commented Oct 6, 2023

The TAF scenarios that failed were all due to the fact that the changes made to the "Test (T) or Check (C)" column name that have been merged into the develop branch of bi-web, bi-api, and TAF are not present in the release/0.8.1 branch off of which this feature branch is based.

Copy link
Contributor

@davedrp davedrp left a comment

Choose a reason for hiding this comment

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

Passed Developer Test

@mlm483 mlm483 merged commit b78c4d2 into release/0.8.1 Oct 6, 2023
@mlm483 mlm483 deleted the feature/BI-1900 branch October 6, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants