Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BI-1930] trait names are case sensitive #300

Merged
merged 2 commits into from
Oct 20, 2023
Merged

[BI-1930] trait names are case sensitive #300

merged 2 commits into from
Oct 20, 2023

Conversation

davedrp
Copy link
Contributor

@davedrp davedrp commented Oct 9, 2023

BI-1930 - trait names are case sensitive

Description

When importing an experiment in the current system, the observation-variable must match an ontology in a case-sensitive way. If not it will fail validation. The purpose of this story is to allow the matching between the observation-variable and the ontology to be case-insensitive, while still allowing the observation-variable and the observation data to be saved correctly.

Dependencies

bi-web: develop branch

Testing

WHEN An experiment is imported with observations.
AND At least one observation-variable (i.e. the observation column header) differs from an ontology by case (for example: if the ontology is "Color" the observation-variable could be "cOLoR").
THEN The experiment should pass validation.

WHEN Viewing the experiment summary.
THEN the observation-variable should be displayed with the same cases as the ontology (in the above example: "Color")

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, nickpalladino and mlm483 and removed request for a team October 9, 2023 19:52
@github-actions github-actions bot added the bug Something isn't working label Oct 9, 2023
@davedrp davedrp changed the title [BI-1930] made observationvariable validations with ontologies case-i… [BI-1930] trait names are case sensitive Oct 9, 2023
Copy link
Contributor

@mlm483 mlm483 left a comment

Choose a reason for hiding this comment

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

The code looks good and acceptance criterion 2 is met but acceptance criterion 1 is not met; a check for values outside of case insensitive "" (blank => Test), "T", "C", "TEST", "CHECK" should be added, and an appropriate error shown.

Also, please run TAF after making those changes, the test files may need to be updated.

My mistake, I mixed up BI-1930 and BI-1890. I'll retest.

@mlm483 mlm483 self-requested a review October 10, 2023 14:06
Copy link
Member

@nickpalladino nickpalladino left a comment

Choose a reason for hiding this comment

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

During testing I was getting a null pointer exception:

java.lang.RuntimeException: java.lang.NullPointerException
	at org.breedinginsight.brapps.importer.services.FileMappingUtil.lambda$sortByField$0(FileMappingUtil.java:90)
	at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
	at java.base/java.util.TimSort.sort(TimSort.java:220)
	at java.base/java.util.Arrays.sort(Arrays.java:1516)
	at java.base/java.util.ArrayList.sort(ArrayList.java:1718)
	at org.breedinginsight.brapps.importer.services.FileMappingUtil.sortByField(FileMappingUtil.java:84)
	at org.breedinginsight.brapps.importer.services.processors.ExperimentProcessor.verifyTraits(ExperimentProcessor.java:439)
	at org.breedinginsight.brapps.importer.services.processors.ExperimentProcessor.process(ExperimentProcessor.java:220)
	at org.breedinginsight.brapps.importer.services.processors.ProcessorManager.process(ProcessorManager.java:65)
	at org.breedinginsight.brapps.importer.model.imports.experimentObservation.ExperimentImportService.process(ExperimentImportService.java:72)
	at org.breedinginsight.brapps.importer.services.FileImportService.lambda$processFile$9(FileImportService.java:426)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1771)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1763)
	at java.base/java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java)
	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)
Caused by: java.lang.NullPointerException: null
	at org.breedinginsight.brapps.importer.services.FileMappingUtil.lambda$sortByField$0(FileMappingUtil.java:88)

	... 19 common frames omitted```

Test files:

[KRSP128_case.xlsx](https://github.com/Breeding-Insight/bi-api/files/12874366/KRSP128_case.xlsx)

[bi_lettuce_ontology_v1.xlsx](https://github.com/Breeding-Insight/bi-api/files/12874371/bi_lettuce_ontology_v1.xlsx)

Copy link
Contributor

@mlm483 mlm483 left a comment

Choose a reason for hiding this comment

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

I'm seeing the Null Pointer Exception as well when uploading Experiment and Observations.

@timparsons timparsons marked this pull request as ready for review October 12, 2023 17:30
@davedrp
Copy link
Contributor Author

davedrp commented Oct 13, 2023

During testing I was getting a null pointer exception:

Bug fixed (and thanks for finding it?)

@timparsons timparsons requested a review from mlm483 October 17, 2023 19:54
Copy link
Contributor

@mlm483 mlm483 left a comment

Choose a reason for hiding this comment

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

Looks good.

@davedrp davedrp closed this Oct 20, 2023
@davedrp davedrp reopened this Oct 20, 2023
@davedrp davedrp merged commit 1640202 into develop Oct 20, 2023
@davedrp davedrp deleted the bug/BI-1930 branch October 20, 2023 16:33
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