Fix foundry _get_app to raise ResourceNotFoundError for missing apps#2065
Merged
Merged
Conversation
mrobers1982
requested review from
ChuckTerry,
Gabefire,
KeshavSahoo,
RainIwakura,
cyrusj89,
lgluszek and
ramy1951
July 10, 2026 20:44
A missing app used to surface from the API as InvalidQueryError, which _get_app mapped to ResourceNotFoundError. The API now returns a generic "not found" LabelboxError instead, so it fell through to the generic wrapper and test_get_app_with_invalid_id (asserting pytest.raises(ResourceNotFoundError)) failed. Detect the not-found LabelboxError and re-raise ResourceNotFoundError, preserving the method's documented contract. ResourceNotFoundError is a subclass of LabelboxError, so other errors still wrap as before. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mrobers1982
force-pushed
the
mrobers1982/fix-backend-drift-assertions
branch
from
July 13, 2026 14:05
f127af3 to
50aa884
Compare
itssujan
approved these changes
Jul 13, 2026
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.
Description
foundry_client._get_appis documented to raiseResourceNotFoundErrorfor a missing app, and did so by mapping the API'sInvalidQueryError. The API now returns a genericLabelboxError(App with id ... not found) instead, so it fell through to the generic wrapper andtest_get_app_with_invalid_id(which assertspytest.raises(ResourceNotFoundError)) failed.This detects the not-found
LabelboxErrorand re-raisesResourceNotFoundError, restoring the method's contract.ResourceNotFoundErroris a subclass ofLabelboxError, so all other errors still wrap exactly as before.Verification
test_get_app_with_invalid_idnow PASSES against staging (run onf127af39).ruff format --check+ruff checkclean.Note
This PR was originally going to also fix
test_labeling_frontend_connecting_to_project, but CI revealed that's a deeper backend removal, not a stale assertion: connecting the legacy "Editor" labeling frontend now returnsMalformedQueryException: Unsupported labeling frontend(per intelligence #30098, only modern Pictor editors are accepted; projects auto-attach the correct one). That test is being handled separately as a removed-capability case.🤖 Generated with Claude Code