Skip to content

add fake data to endpoint#203

Merged
rlreamy merged 1 commit intodevelopfrom
KPMP-6504_return-fake-st-data
Jan 20, 2026
Merged

add fake data to endpoint#203
rlreamy merged 1 commit intodevelopfrom
KPMP-6504_return-fake-st-data

Conversation

@Dert1129
Copy link
Contributor

@Dert1129 Dert1129 commented Jan 20, 2026

Summary by CodeRabbit

  • New Features
    • Spatial transcriptomics is now available as an attribute in cluster hierarchy data, enabling enhanced cluster metadata organization.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

Walkthrough

Adds spatial transcriptomics support to ClusterHierarchy by introducing a new field across three layers: a transient String field in the Java model with Jackson serialization, a test entry in the service layer, and a GraphQL schema field for external API exposure.

Changes

Cohort / File(s) Summary
Model Enhancement
src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java
Introduces isSpatialTranscriptomics transient String field with @JsonProperty annotated getter and setter methods; adds necessary Jackson and Transient imports.
Service Layer
src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyService.java
Appends a new test entry (bogusST) to results with isSpatialTranscriptomics set to "Y", demonstrating the field usage.
GraphQL Schema
src/main/resources/graphql/knowledge_environment.graphqls
Exposes isSpatialTranscriptomics: String field in the ClusterHierarchy type definition for API consumers.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchyService.java (1)

63-68: Potential NPE in comparator if cellTypeOrder is null.

The comparator calls a.getCellTypeOrder().compareTo(b.getCellTypeOrder()) directly. Since getCellTypeOrder() returns Double (nullable, annotated with @Nullable in the model), any entry with a null cellTypeOrder will cause a NullPointerException.

While the new entries (bogusST, tiCluster) set this value explicitly, entries from the database via clusterToHierarchy could potentially have null values.

Suggested null-safe comparator
-        Collections.sort(result, new Comparator<ClusterHierarchy>() {
-            `@Override`
-            public int compare(ClusterHierarchy a, ClusterHierarchy b) {
-                return a.getCellTypeOrder().compareTo(b.getCellTypeOrder());
-            }
-        });
+        Collections.sort(result, Comparator.comparing(
+            ClusterHierarchy::getCellTypeOrder,
+            Comparator.nullsLast(Comparator.naturalOrder())
+        ));
🧹 Nitpick comments (1)
src/main/java/org/kpmp/cellTypeSummary/ClusterHierarchy.java (1)

14-14: Unused import.

JsonInclude is imported but not used in this class. Consider removing it to keep imports clean.

Suggested fix
-import com.fasterxml.jackson.annotation.JsonInclude;

@rlreamy rlreamy merged commit 59263f3 into develop Jan 20, 2026
1 check passed
@rlreamy rlreamy deleted the KPMP-6504_return-fake-st-data branch January 20, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants