Skip to content

[DOP-23867] Change API schema for lineage endpoints#164

Merged
dolfinus merged 1 commit intodevelopfrom
feature/DOP-23867
Feb 13, 2025
Merged

[DOP-23867] Change API schema for lineage endpoints#164
dolfinus merged 1 commit intodevelopfrom
feature/DOP-23867

Conversation

@dolfinus
Copy link
Member

@dolfinus dolfinus commented Feb 13, 2025

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

  • Commit message and PR title is comprehensive
  • Keep the change as small as possible
  • Unit and integration tests for the changes exist
  • Tests pass on CI and coverage does not decrease
  • Documentation reflects the changes where applicable
  • docs/changelog/next_release/<pull request or issue id>.<change type>.rst file added describing change
    (see CONTRIBUTING.rst for details.)
  • My PR is ready to review.

@codecov
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.17%. Comparing base (d9ac4dd) to head (3dbda93).
Report is 132 commits behind head on develop.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dolfinus dolfinus marked this pull request as ready for review February 13, 2025 10:36
@dolfinus dolfinus merged commit e59fce9 into develop Feb 13, 2025
14 checks passed
@dolfinus dolfinus deleted the feature/DOP-23867 branch February 13, 2025 12:16
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