Skip to content

[BI-1803] - Excel formatting preventing ontology file import#257

Merged
mlm483 merged 3 commits intodevelopfrom
bug/BI-1803
Jun 7, 2023
Merged

[BI-1803] - Excel formatting preventing ontology file import#257
mlm483 merged 3 commits intodevelopfrom
bug/BI-1803

Conversation

@mlm483
Copy link
Contributor

@mlm483 mlm483 commented May 30, 2023

Description

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

NOTE: import code for Ontology, Germplasm and Experiments & Observations will eventually be unified, see https://breedinginsight.atlassian.net/browse/BI-1796, but for now Ontology has it's own file parsing methods, etc., which is why this bug is specific to Ontology.

Empty or null rows in Excel or CSV files were causing errors during Ontology upload.
To fix this, the ExcelParser::parse method now drops empty and null rows.

For Excel files, the empty cells are null whereas for CSV they are empty strings (""). Because ExcelParser::parse is used by both Excel and CSV imports, I made sure to handle both situations.

I added unit tests and .xls, .xlsx and .csv test files.

Testing

Example test files below, you can make your own by clearing rows in an Excel file and saving as .xls, .xlsx, .csv.

BI-1803 6 Phenos Ontology -row height changed.csv
BI-1803 6 Phenos Ontology -row height changed.xls

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/5126403136

@github-actions github-actions bot added the bug Something isn't working label May 30, 2023
@mlm483 mlm483 marked this pull request as ready for review May 30, 2023 22:02
@mlm483 mlm483 requested review from a team, davedrp and dmeidlin and removed request for a team May 30, 2023 22:02
@davedrp
Copy link
Contributor

davedrp commented May 31, 2023

Passed Developer Testing

@mlm483 mlm483 merged commit 44a900c into develop Jun 7, 2023
@mlm483 mlm483 deleted the bug/BI-1803 branch June 7, 2023 15:00
@mlm483 mlm483 restored the bug/BI-1803 branch June 7, 2023 17:20
@mlm483 mlm483 deleted the bug/BI-1803 branch June 9, 2023 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants