Skip to content

feat: add get_lineage() to Python client#3101

Closed
psaikaushik wants to merge 1 commit into
MarquezProject:mainfrom
psaikaushik:feat/1798-add-get-lineage-to-python-client
Closed

feat: add get_lineage() to Python client#3101
psaikaushik wants to merge 1 commit into
MarquezProject:mainfrom
psaikaushik:feat/1798-add-get-lineage-to-python-client

Conversation

@psaikaushik
Copy link
Copy Markdown

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 raw curl calls.\n\nCloses #1798 (Python client portion)\n\n## What Changed\n\nAdded MarquezClient.get_lineage() that calls GET /api/v1/lineage?nodeId=<nodeId>&depth=<depth>.\n\nThe method follows the same patterns as existing client methods:\n- Input validation (node_id must not be None)\n- Uses DEFAULT_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

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
@boring-cyborg
Copy link
Copy Markdown

boring-cyborg Bot commented Apr 12, 2026

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
Copy link
Copy Markdown

codecov Bot commented Apr 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.18%. Comparing base (180f37b) to head (53eef39).

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.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@psaikaushik
Copy link
Copy Markdown
Author

Closing in favor of #3104 which fixes the PR description formatting and includes DCO sign-off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant