Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
17051e4
[BI-2009] - Dynamic Concatenation of Entity + ObsUnitID (Exp UI)
HMS17 Apr 21, 2025
c493e9b
[BI-2009] - retrieve obslvl
HMS17 Apr 28, 2025
635a203
[BI-2009] - Unit test fix part 1
HMS17 Apr 29, 2025
2248dd1
[BI-2009] - Unit test matching labels update
HMS17 Apr 29, 2025
0e91c05
[BI-2009] - always those one character typos
HMS17 Apr 29, 2025
7a5306c
[BI-2009] - Fix row labels
HMS17 Apr 29, 2025
992cb70
[BI-2009] - fixed variable that gets appended
HMS17 May 1, 2025
fe7de2d
[BI-2009] - Unit test fixing
HMS17 May 1, 2025
3ebbe37
[BI-2009] - Multi env case
HMS17 May 1, 2025
29b14cc
[BI-2009] - Cleanup
HMS17 May 1, 2025
e5045cc
[BI-2009] - Override hashCode
HMS17 May 5, 2025
b3aff54
[BI-2009] - Another hashcode fix
HMS17 May 5, 2025
bf60e06
Use appropriate ids for both preview and commit
nickpalladino Apr 7, 2025
2745394
Refactored to clean up a bit
nickpalladino Apr 8, 2025
0345ce3
Added file header
nickpalladino Apr 8, 2025
927885f
Added test case
nickpalladino Apr 8, 2025
03783ba
[autocommit] bumping build number
rob-ouser-bi Apr 9, 2025
f725120
Switched to using gids to track germplasm
nickpalladino Apr 8, 2025
3fb9039
Removed unused code
nickpalladino Apr 9, 2025
2d680d7
[BI-2578] Support for unpaginated RQs to BrAPI server for cache loading
jloux-brapi Mar 14, 2025
cfcce99
Add comment about configurable variable on brapi test server side
jloux-brapi Mar 17, 2025
4ea3793
[BI-2578] Add config props for max rq page size and pagination flippe…
jloux-brapi Mar 19, 2025
d92659c
Add test server template props to bi-api
jloux-brapi Mar 31, 2025
9ac32af
Fix unit test errors related to new property not loading
jloux-brapi Apr 2, 2025
039db3d
Fix unit test failure related to searchNoPaging function
jloux-brapi Apr 2, 2025
e157780
Add germplasm name validation
nickpalladino Apr 23, 2025
9195b92
Add test for germplasm name validation
nickpalladino Apr 23, 2025
d1e0c23
[BI-2595] - added logging
mlm483 Apr 15, 2025
d9e5aa4
[BI-2595] - reverted dependency changes
mlm483 Apr 18, 2025
f261e44
[REVERT ME] - temporary test configuration change
mlm483 Apr 24, 2025
053e19c
[BI-2608] Changed column-name from 'Long' to 'Elevation' in error mes…
davedrp Apr 23, 2025
115efbe
Update src/test/java/org/breedinginsight/BrAPITest.java
mlm483 Apr 30, 2025
5e1d14c
[BI-2579] Forgo cache refresh on response from server during germ imp…
jloux-brapi Mar 14, 2025
b4875b4
Fully populate program germplasm cache when upload completes
jloux-brapi Mar 20, 2025
1ae7ed4
Add properties added to test server properties file
jloux-brapi Mar 31, 2025
5f04fb6
Restore functionality of using post return values
jloux-brapi Mar 31, 2025
f225f5e
Merge branch 'future/1.2' into feature/BI-2009
HMS17 May 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,19 @@ public DownloadFile exportObservations(
}
}

//dynamically append observation level to obsUnitID column header
String observationLvl = ous.get(0).getAdditionalInfo().get(BrAPIAdditionalInfoFields.OBSERVATION_LEVEL).getAsString();
columns = dynamicUpdateObsUnitIDLabel(columns, observationLvl);

log.debug(logHash + ": writing data to file for export");
// If one or more envs requested, create a separate file for each env, then zip if there are multiple.
if (!requestedEnvIds.isEmpty()) {
// This will hold a list of rows for each study, each list will become a separate file.
Map<String, List<Map<String, Object>>> rowsByStudyId = new HashMap<>();
String obsUnitIDLabel = observationLvl + " " + ExperimentObservation.Columns.OBS_UNIT_ID;

for (Map<String, Object> row: rowByOUId.values()) {
String studyId = studyDbIdByOUId.get((String)row.get(ExperimentObservation.Columns.OBS_UNIT_ID));
String studyId = studyDbIdByOUId.get((String)row.get(obsUnitIDLabel));
// Initialize key with empty list if it is not present.
if (!rowsByStudyId.containsKey(studyId))
{
Expand Down Expand Up @@ -306,6 +311,19 @@ private StreamedFile zipFiles(List<DownloadFile> files) throws IOException {
return new StreamedFile(in, new MediaType(MediaType.APPLICATION_OCTET_STREAM));
}

public List<Column> dynamicUpdateObsUnitIDLabel(List<Column> columns, String observationLvl){
Column oldObsUnitIDCol = new Column(ExperimentObservation.Columns.OBS_UNIT_ID, Column.ColumnDataType.STRING);
String dynamicLabel = observationLvl + " " + ExperimentObservation.Columns.OBS_UNIT_ID;
Column dynamicLabelObsUnitIDCol = new Column(dynamicLabel, Column.ColumnDataType.STRING);
//need to check index of is valid
int index = columns.indexOf(oldObsUnitIDCol);
//find item in cols with val ExperimentObservation.Columns.OBS_UNIT_ID
if (index != -1) {
columns.set(index, dynamicLabelObsUnitIDCol);
}
return columns;
}

public Dataset getDatasetData(Program program, UUID experimentId, UUID datasetId, Boolean stats) throws ApiException, DoesNotExistException {
log.debug("fetching dataset: " + datasetId + " for experiment: " + experimentId + ". including stats: " + stats);
log.debug("fetching observationUnits for dataset: " + datasetId);
Expand Down Expand Up @@ -785,7 +803,10 @@ private Map<String, Object> createExportRow(
} else {
row.put(ExperimentObservation.Columns.TREATMENT_FACTORS, null);
}
row.put(ExperimentObservation.Columns.OBS_UNIT_ID, ouId);

//Append observation level to obsUnitID
String observationLvl = ou.getAdditionalInfo().getAsJsonObject().get(BrAPIAdditionalInfoFields.OBSERVATION_LEVEL).getAsString();
row.put(observationLvl + " " + ExperimentObservation.Columns.OBS_UNIT_ID, ouId);

return row;
}
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/org/breedinginsight/model/Column.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;

import java.util.Objects;

@Getter
@Setter
@Accessors(chain=true)
Expand All @@ -46,4 +48,17 @@ public enum ColumnDataType {
INTEGER,
DOUBLE
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Column that = (Column) o;
return Objects.equals(getValue(), that.getValue()) && Objects.equals(getDataType(), that.getDataType());
}

@Override
public int hashCode() {
return Objects.hash(getValue(), getDataType());
}
}
5 changes: 5 additions & 0 deletions src/main/java/org/breedinginsight/model/Country.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,9 @@ public boolean equals(Object o) {
Country that = (Country) o;
return Objects.equals(getId(), that.getId()) && Objects.equals(getName(), that.getName());
}

@Override
public int hashCode() {
return Objects.hash(getId(), getName());
}
}
3 changes: 2 additions & 1 deletion src/main/resources/version.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
# limitations under the License.
#


version=v1.2.0+961
versionInfo=https://github.com/Breeding-Insight/bi-api/commit/06df6ae9acb10d77620dc978d8f1c290dab21324
versionInfo=https://github.com/Breeding-Insight/bi-api/commit/06df6ae9acb10d77620dc978d8f1c290dab21324
Original file line number Diff line number Diff line change
Expand Up @@ -987,10 +987,11 @@ private void checkDownloadTable(
}
assertEquals(requestedImportRows.size(),matchingImportRows.size());

//Observation level for tests should be "Plot"
// Observation units populated.
assertEquals(0, table.column("ObsUnitID").countMissing());
assertEquals(0, table.column("Plot ObsUnitID").countMissing());
// Observation Unit IDs are assigned.
assertEquals(requestedImportRows.size(), table.column("ObsUnitID").countUnique());
assertEquals(requestedImportRows.size(), table.column("Plot ObsUnitID").countUnique());
}

private boolean isMatchedRow(Map<String, Object> importRow, Row downloadRow) {
Expand Down
Loading