BI-1195 - 4.3 Exp Preview: Append Experiment with Observations#241
BI-1195 - 4.3 Exp Preview: Append Experiment with Observations#241timparsons merged 15 commits intodevelopfrom
Conversation
ddf15ec to
e3e713a
Compare
src/main/java/org/breedinginsight/brapi/v2/GermplasmController.java
Outdated
Show resolved
Hide resolved
src/main/java/org/breedinginsight/brapps/importer/daos/BrAPITrialDAO.java
Outdated
Show resolved
Hide resolved
src/main/java/org/breedinginsight/brapps/importer/services/processors/ExperimentProcessor.java
Outdated
Show resolved
Hide resolved
4b896f0 to
e52d6ae
Compare
src/main/java/org/breedinginsight/brapps/importer/daos/BrAPIObservationUnitDAO.java
Outdated
Show resolved
Hide resolved
| ); | ||
| } | ||
|
|
||
| public Optional<BrAPIStudy> getStudyByDbId(String studyDbId, Program program) throws ApiException { |
There was a problem hiding this comment.
I don't think getStudyByDbId() is ever called
There was a problem hiding this comment.
Yep, you're right. Thoughts on leaving it as I can see it being used at some point?
src/main/java/org/breedinginsight/brapps/importer/daos/BrAPITrialDAO.java
Show resolved
Hide resolved
| @@ -24,6 +24,7 @@ | |||
| import org.breedinginsight.brapps.importer.model.config.ImportFieldType; | |||
There was a problem hiding this comment.
the statement import org.brapi.v2.model.core.BrAPILocation; is no longer needed.
src/main/java/org/breedinginsight/brapps/importer/services/FileImportService.java
Show resolved
Hide resolved
| import org.breedinginsight.model.User; | ||
| import org.breedinginsight.services.ProgramLocationService; | ||
| import org.breedinginsight.services.exceptions.ValidatorException; | ||
| import org.breedinginsight.utilities.Utilities; |
| import org.brapi.client.v2.BrAPIClient; | ||
| import org.brapi.client.v2.model.exceptions.ApiException; | ||
| import org.brapi.client.v2.model.queryParams.phenotype.VariableQueryParams; | ||
| import org.brapi.client.v2.modules.core.LocationsApi; |
| ProgramLocation location = dsl.transactionResult(configuration -> { | ||
| programLocationDao.insert(placeEntity); | ||
| ProgramLocation progLocation = programLocationDao.getById(programId, placeEntity.getId()).get(); | ||
| ProgramLocation progLocation = programLocationDao.getById(programId, placeEntity.getId(), false).get(); |
There was a problem hiding this comment.
'Optional.get()' without 'isPresent()' check
| ProgramLocation location = dsl.transactionResult(configuration -> { | ||
| programLocationDao.update(placeEntity); | ||
| ProgramLocation progLocation = programLocationDao.getById(programId, placeEntity.getId()).get(); | ||
| ProgramLocation progLocation = programLocationDao.getById(programId, placeEntity.getId(), false).get(); |
There was a problem hiding this comment.
'Optional.get()' without 'isPresent()' check
| return ret; | ||
| } | ||
|
|
||
| private Map<String, Object> assertValidPreviewRow(Map<String, Object> expected, JsonObject actual, Program program, List<Trait> traits) { |
There was a problem hiding this comment.
is this private method ever called
There was a problem hiding this comment.
Not at the moment. I was thinking that there should probably be some tests added for preview of import (current tests are only focused on the full save), so it may be worth keeping this here. Thoughts?
src/main/java/org/breedinginsight/brapps/importer/services/processors/ExperimentProcessor.java
Show resolved
Hide resolved
|
Test failed - see the comment |
e52d6ae to
bda0c86
Compare
|
Unit Test passed |
… experiment file import
… observations to existing OUs Also refactored the ExperimentProcessor to improve readability/maintainability
More refactored to the ExperimentProcessor to improve readability/maintainability
Fixing bugs and adding methods as needed to get the tests to pass
Added a migration for updating existing locations with a program xref
bda0c86 to
ace31c9
Compare
…a BrAPI search request Returning an empty list if list parameters are empty
Description
Story: https://breedinginsight.atlassian.net/browse/BI-1195
ObsUnitIdcolumn in an experiment import fileExperimentProcessorto be easier to readDependencies
bi-web: Breeding-Insight/bi-web#302
sgn: Breeding-Insight/sgn#109
Testing
This code isn't testable via the UI with BreedBase until the UI to download an experiment with ObsUnitIds is implemented, however, you can hit the BrAPI endpoints to fetch the ObservationUnit external references that were generated by DeltaBreed to then put into an import file.
ExperimentFileImportTestfor coverageExperimentFileImportTestand verify all tests passChecklist: