[BI-1803] - Excel formatting preventing ontology file import#257
Merged
[BI-1803] - Excel formatting preventing ontology file import#257
Conversation
Contributor
|
Passed Developer Testing |
davedrp
approved these changes
May 31, 2023
dmeidlin
approved these changes
Jun 7, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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::parsemethod now drops empty and null rows.For Excel files, the empty cells are null whereas for CSV they are empty strings (""). Because
ExcelParser::parseis 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: