Skip to content

[BI-1194] - Upload with timestamps#225

Merged
HMS17 merged 14 commits intodevelopfrom
feature/BI-1194
Nov 29, 2022
Merged

[BI-1194] - Upload with timestamps#225
HMS17 merged 14 commits intodevelopfrom
feature/BI-1194

Conversation

@HMS17
Copy link
Contributor

@HMS17 HMS17 commented Nov 10, 2022

Description

Story: BI-1194 - Upload with timestamps

Changes to Experiment Import to enable import and preview display of timestamps associated with phenotypes.

  • Updated excel parsing to distinguish between date and numeric values
  • Updated csv parsing to interpret dates as strings due to jackson messily converting LOCAL_DATE/LOCAL_DATETIME
  • Added changes to pass list of ordered dynamic column names for display (since ordering lost in jsonb conversion to object)
  • Added migration to store dynamic column names in importer_import table
  • Added validation for timestamp column names and values
  • Updated storing of observations to add corresponding timestamp if present

Dependencies

bi-web/BI-1194

Testing

see bi-web

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>

@HMS17 HMS17 marked this pull request as ready for review November 17, 2022 23:10
@HMS17 HMS17 requested review from davedrp and timparsons November 17, 2022 23:11
Copy link
Member

@timparsons timparsons left a comment

Choose a reason for hiding this comment

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

Code looks great! Have some very minor suggested changes, but approving with the assumption they will be addressed

PendingImportObject<BrAPIObservation> obsPIO = createObservationPIO(importRow, column.name(), column.getString(i));
//If associated timestamp column, add
String dateTimeValue = null;
if (timeStampColByPheno.get(column.name())!=null) {
Copy link
Member

Choose a reason for hiding this comment

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

from a code style standpoint, could you put spaces around !=. It will make the code more readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

if (timeStampColByPheno.get(column.name())!=null) {
dateTimeValue = timeStampColByPheno.get(column.name()).getString(i);
//If no timestamp, set to midnight
if (!validDateTimeValue(dateTimeValue) && !dateTimeValue.isBlank()){
Copy link
Member

Choose a reason for hiding this comment

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

Your logic here is sound. Minor suggestion, switch the order of the checks so that the isBlank check is first. This is easier to compute than validating the date/time, and can reduce the amount of work the system has to do when importing a file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, switched

@HMS17 HMS17 merged commit 71e791b into develop Nov 29, 2022
@HMS17 HMS17 deleted the feature/BI-1194 branch November 29, 2022 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants