fix: raise NotFoundError on 404 from chained .get() without ID#755
Open
fix: raise NotFoundError on 404 from chained .get() without ID#755
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #755 +/- ##
==========================================
- Coverage 95.55% 95.19% -0.37%
==========================================
Files 45 45
Lines 5152 5156 +4
==========================================
- Hits 4923 4908 -15
- Misses 229 248 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
`.get()` previously collapsed every 404 into `None` via `catch_not_found_or_throw`. That works for direct, ID-identified fetches (`client.dataset(id).get()`), where a 404 unambiguously means the named resource is missing. It's misleading for chained calls that target a default sub-resource without an ID (`run.dataset()`, `run.key_value_store()`, `run.request_queue()`, `run.log()`): a 404 there could mean the parent run is missing or the default sub-resource is missing, and the API body cannot disambiguate the two. This change keeps the `None` behavior for ID-identified clients and propagates `NotFoundError` from chained clients (`self._resource_id is None`). The v3 upgrade guide is updated to document the new semantics, and sync/async tests cover both code paths.
84e57c0 to
8b6773d
Compare
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.
Follow-up to #737 (comment)
.get()previously collapsed every 404 intoNoneviacatch_not_found_or_throw. That works for direct, ID-identified fetches (client.dataset(id).get()), where a 404 unambiguously means the named resource is missing. It's misleading for chained calls that target a default sub-resource without an ID (run.dataset(),run.key_value_store(),run.request_queue(),run.log()): a 404 there could mean the parent run is missing or the default sub-resource is missing, and the API body cannot disambiguate the two.This PR keeps the
Nonebehavior for ID-identified clients and propagatesNotFoundErrorfrom chained clients (self._resource_id is None). The v3 upgrade guide is updated to document the new semantics, and sync/async tests cover both code paths.