[DOP-23867] Change API schema for lineage endpoints#164
Merged
Conversation
52f8ab8 to
0e94519
Compare
0e94519 to
9f2b276
Compare
9f2b276 to
3dbda93
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #164 +/- ##
===========================================
+ Coverage 93.16% 93.17% +0.01%
===========================================
Files 185 185
Lines 4228 4236 +8
Branches 281 279 -2
===========================================
+ Hits 3939 3947 +8
Misses 227 227
Partials 62 62 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
TiGrib
approved these changes
Feb 13, 2025
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.
Change Summary
Using flat lists for all relation types and node types is not very efficient to use on client/UI side.
Instead, split relations to different lists, one for each relation type, and split nodes to differents dict[id, Node], one for each node type. This is more efficient to use, because we can replace O(n) filters with O(n) with much smaller n, or even with O(1).
As JSON format requires all object keys to be strings, change id types for dataset, job and location from int to str. This is applied only to API responses, but not to query params, as DB models still have numeric primary keys.
This also get rid of Union response types, so we can update Pydantic to 2.10 and not suffer from slowdown during serialization.
Related issue number
Checklist
docs/changelog/next_release/<pull request or issue id>.<change type>.rstfile added describing change(see CONTRIBUTING.rst for details.)