[FSTORE-1912] java client-fix for 400 error code change for feature group not found#956
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
The Hopsworks backend changed the HTTP status code returned when a feature group is not found from 404 to 400, while keeping the same errorCode (270009). The Java client's getOrCreateFeatureGroup was matching on both the Error: 404 substring and the error code, so after the backend change it would propagate the error instead of creating the feature group. This PR loosens the match to rely on the error code only, and adds unit tests covering both the not-found-and-create path and the rethrow path.
Changes:
- Drop the
Error: 404substring check inFeatureGroupEngine.getOrCreateFeatureGroup, keeping only theerrorCode:270009check so both 400 and 404 responses trigger creation. - Add
TestFeatureGroupEnginewith tests for the 400-not-found path, the existing-FG path, and rethrow of unrelated errors.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| java/hsfs/src/main/java/com/logicalclocks/hsfs/engine/FeatureGroupEngine.java | Relax the error matcher so the not-found-and-create branch triggers regardless of HTTP status code. |
| java/hsfs/src/test/java/com/logicalclocks/hsfs/engine/TestFeatureGroupEngine.java | New unit tests for getOrCreateFeatureGroup covering create-on-not-found, existing FG, and rethrow paths. |
manu-sj
approved these changes
May 22, 2026
dhananjay-mk
added a commit
to dhananjay-mk/hopsworks-api
that referenced
this pull request
May 25, 2026
…und (logicalclocks#956)" This reverts commit 2f8dcf1.
Merged
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds/fixes/changes...
JIRA Issue: -
Priority for Review: -
Related PRs: -
How Has This Been Tested?
Checklist For The Assigned Reviewer: