feat: add get_lineage() to Python client#3101
Closed
psaikaushik wants to merge 1 commit into
Closed
Conversation
Add MarquezClient.get_lineage(node_id, depth) method that fetches the lineage graph for a given node via GET /api/v1/lineage. The node_id format follows the existing convention: - For datasets: "dataset:<namespace>:<name>" - For jobs: "job:<namespace>:<name>" This was the last missing piece — users could already fetch column lineage but not the standard lineage graph from the Python client. Closes MarquezProject#1798
|
Thanks for opening your first pull request in the Marquez project! Please check out our contributing guidelines (https://github.com/MarquezProject/marquez/blob/main/CONTRIBUTING.md). |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3101 +/- ##
=========================================
Coverage 81.18% 81.18%
Complexity 1506 1506
=========================================
Files 268 268
Lines 7356 7356
Branches 325 325
=========================================
Hits 5972 5972
Misses 1226 1226
Partials 158 158 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Author
|
Closing in favor of #3104 which fixes the PR description formatting and includes DCO sign-off. |
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.
Summary\n\nAdds the missing
get_lineage(node_id, depth)method to the Python client, allowing users to fetch the lineage graph for any node directly from Python without resorting to rawcurlcalls.\n\nCloses #1798 (Python client portion)\n\n## What Changed\n\nAddedMarquezClient.get_lineage()that callsGET /api/v1/lineage?nodeId=<nodeId>&depth=<depth>.\n\nThe method follows the same patterns as existing client methods:\n- Input validation (node_idmust not be None)\n- UsesDEFAULT_DEPTH(20) when depth is not specified\n- Returns the parsed JSON response\n\n## Usage\n\npython\nfrom marquez_client import MarquezClient\n\nclient = MarquezClient(url='http://localhost:8080')\n\n# Get lineage for a dataset\nlineage = client.get_lineage('dataset:my_namespace:my_dataset')\n\n# Get lineage for a job with custom depth\nlineage = client.get_lineage('job:my_namespace:my_job', depth=5)\n\n\n## Note\n\nThis PR covers the Python client. The Java client portion of #1798 will be a separate PR.\n\n## Checklist\n- [x] Follows existing client patterns\n- [x] Includes docstring with node_id format examples\n- [x] Input validation for required parameters