BI-1183 - Import Validations: Ontology-specific observation criteria#210
BI-1183 - Import Validations: Ontology-specific observation criteria#210nickpalladino merged 97 commits intodevelopfrom
Conversation
[BI-1198] All Experiments Table
Converted semaphore to use Redisson's semaphore (distributed semaphore)
…ce/impl design pattern Introduced flag to suppress refreshing cache on startup if desired (useful for integration tests)
| @Override | ||
| public Map<String, ImportPreviewStatistics> process(List<BrAPIImport> importRows, | ||
| Map<Integer, PendingImport> mappedBrAPIImport, Program program, User user, boolean commit) throws ValidatorException { | ||
| Map<Integer, PendingImport> mappedBrAPIImport, Table table, |
There was a problem hiding this comment.
Minor thing, but is there a reason you went with Table table here and in Processor.java and then Table data in other files?
There was a problem hiding this comment.
Nope, I will change them all to data to be consistent. Pushed changes.
| ValidationErrors validationErrors = new ValidationErrors(); | ||
|
|
||
| // Get dynamic phenotype columns for processing | ||
| List<Column<?>> phenotypeCols = fileMappingUtil.getDynamicColumns(data, "ExperimentsTemplateMap"); |
There was a problem hiding this comment.
Is there a constant that's defined anywhere for the ExperimentsTemplateMap? If not, can that be added?
There was a problem hiding this comment.
No, I'll add one. Pushed changes.
| Function3<String, Integer, Integer, ApiResponse<Pair<Optional<T>, Optional<BrAPIAcceptedSearchResponse>>>> searchGetMethod3, | ||
| Function4<BrAPIWSMIMEDataTypes, String, Integer, Integer, ApiResponse<Pair<Optional<T>, Optional<BrAPIAcceptedSearchResponse>>>> searchGetMethod4, |
There was a problem hiding this comment.
For naming of these to parameters, what about:
searchGetMethod3goes back tosearchGetMethodsearchGetMethod4changes tosearchGetMethodWithMimeType
There was a problem hiding this comment.
Sounds good, also added method to reuse, pushed changes.
d60da41 to
7cb9557
Compare
There was a problem hiding this comment.
I had tried importing 4 files:
Result: FAIL - Error during validation:
java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.get(Optional.java:141)
at org.breedinginsight.brapps.importer.services.processors.ExperimentProcessor.validateObservationValue(ExperimentProcessor.java:757)
at org.breedinginsight.brapps.importer.services.processors.ExperimentProcessor.process(ExperimentProcessor.java:209)
at org.breedinginsight.brapps.importer.services.processors.ProcessorManager.process(ProcessorManager.java:65)
at org.breedinginsight.brapps.importer.model.imports.experimentObservation.ExperimentImportService.process(ExperimentImportService.java:71)
at org.breedinginsight.brapps.importer.services.FileImportService.lambda$processFile$4(FileImportService.java:406)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1771)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1763)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Result: PASS - was presented with the preview table
Result: PASS - Error showing unrecognized columns
Result: FAIL - Error during validation:
java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.get(Optional.java:141)
at org.breedinginsight.brapps.importer.services.processors.ExperimentProcessor.validateObservationValue(ExperimentProcessor.java:757)
at org.breedinginsight.brapps.importer.services.processors.ExperimentProcessor.process(ExperimentProcessor.java:209)
at org.breedinginsight.brapps.importer.services.processors.ProcessorManager.process(ProcessorManager.java:65)
at org.breedinginsight.brapps.importer.model.imports.experimentObservation.ExperimentImportService.process(ExperimentImportService.java:71)
at org.breedinginsight.brapps.importer.services.FileImportService.lambda$processFile$4(FileImportService.java:406)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1771)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1763)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Traits used: bi_ontology_template_v11_2021-12-01-test-ontology-with-method-desc.xls
Pushed fix for failing cases |
| try { | ||
| traits = ontologyService.getTraitsByProgramId(program.getId(), true); | ||
| } catch (DoesNotExistException e) { | ||
| log.error(e.getMessage()); |
There was a problem hiding this comment.
Can you add the exception e as a second parameter to this log statement (that way the stack trace will be printed too)
There was a problem hiding this comment.
Yep, pushed changes.
| break; | ||
| case DATE: | ||
| if (!validDateValue(value)) { | ||
| addRowError(columnHeader, "Incorrect date format (YYYY-MM-DD) detected", validationErrors, row); |
There was a problem hiding this comment.
This error message is a little confusing. What about "Incorrect date format detected. Expected YYYY-MM-DD"?
There was a problem hiding this comment.
Sure, pushed changes.
| } | ||
|
|
||
| private boolean validNumericRange(BigDecimal value, Scale validValues) { | ||
| if (value.compareTo(BigDecimal.valueOf(validValues.getValidValueMin())) >= 0 && |
There was a problem hiding this comment.
This code will throw a NullPointerException if validValues.getValidValueMin or validValues.getValidValueMax are null
There was a problem hiding this comment.
Thanks for spotting that, pushed changes.
Description
Story: BI-1183
Dependencies
Testing
Checklist: