Skip to content

Bug/bi 2126#380

Merged
davedrp merged 5 commits intodevelopfrom
bug/BI-2126
Aug 6, 2024
Merged

Bug/bi 2126#380
davedrp merged 5 commits intodevelopfrom
bug/BI-2126

Conversation

@davedrp
Copy link
Contributor

@davedrp davedrp commented Jul 24, 2024

Description

BI-2126 Env year missing from dataset view

Now the Env Year is fetched on the back-end and passed to the front-end in the additional_Info element of each Observation Unit.

Dependencies

bi-api: bug/BI-2126 branch

Testing

  1. Vew any experiment.
    EXPECTED RESULT
  • The correct Env Year should be displayed for each Observation Unit.

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: <please include a link to TAF run>

@davedrp davedrp requested review from a team, mlm483 and nickpalladino and removed request for a team July 24, 2024 19:26
@github-actions github-actions bot added the bug Something isn't working label Jul 24, 2024
List<BrAPIObservationUnit> datasetOUs = ouDAO.getObservationUnitsForDataset(datasetId.toString(), program);

//Add years to the addition_info elements
Map<String, Integer> studyDbId2Year = new HashMap<>(); // used to prevent the same study from being fetched repeatedly.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should create a card to cache seasons in redis, I think this has come up elsewhere in the experiment processor as well. It looks like some of the study dao methods use the program cache but the one used here doesn't so makes sense for now but maybe in the future we could look at utilizing the redis cache.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created the story BI-2126 Cache seasons in redis.
The Code is now using getStudyByEnvironmentId() to fetch the Study from cache.

@nickpalladino
Copy link
Member

Tested and working

List<BrAPIObservationUnit> datasetOUs = ouDAO.getObservationUnitsForDataset(datasetId.toString(), program);

//Add years to the addition_info elements
Map<String, Integer> studyDbId2Year = new HashMap<>(); // used to prevent the same study from being fetched repeatedly.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the naming of studyDbId2Year could be more clear, for example yearByStudyDbId would indicate that you can use the map to look up a year by a studyDbId and would also have parallelism with other maps in bi-api that are named {value}By{key}.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done (and thank you)

@davedrp davedrp requested review from mlm483 and nickpalladino July 26, 2024 14:43
@davedrp davedrp merged commit a43d6a0 into develop Aug 6, 2024
@davedrp davedrp deleted the bug/BI-2126 branch August 6, 2024 19:34
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