impactgraph
What breaks if I merge this? — a pre-merge safety net for code and data.
impactgraph takes the git diff of a pull request, maps it onto a deterministic dependency graph
(Python/JS functions → Lambdas/APIs → tables → dbt models → columns → dashboards) and reports the
blast radius, risk level, owners to notify and a test plan — as a terminal report, JSON, a
Markdown PR comment, or an interactive HTML view — with an exit code you can gate CI on.
It is the pull-request product built on datagraph, the engine that holds everything data-related: extractors (Python, dbt, SQL, warehouse metadata, Airflow, Lambda, JS, OpenLineage, DataHub, plugins), lineage, relationships, profiling, the knowledge base for AI assistants and the MCP server. impactgraph re-exports the whole engine, so one install gives you both.
git diff ──► changed functions / models / files ──► graph walk ──► risk · owners · tests
Install
pip install impactgraph # core (pulls in datagraph)
pip install "impactgraph[sql]" # + sqlglot for .sql files and column lineage
pip install "impactgraph[all]" # + yaml, anthropic (AI explanation), mcp
30-second use
# uncommitted changes in the working tree, Python code + dbt
impactgraph check --repo . --dbt-manifest target/manifest.json
# a PR branch against main, Markdown for the PR comment, fail the job at HIGH or above
impactgraph check --repo . --base origin/main --format markdown --fail-on HIGH
# machine-readable, and keep the graph for later questions
impactgraph check --repo . --base origin/main --format json --save-graph impactgraph.json
impactgraph impact dbt:customer --graph impactgraph.json # any datagraph command passes through
impactgraph lineage table:prod.analytics.dim_customer --graph impactgraph.json
impactgraph context dim_customer --graph impactgraph.json # knowledge pack for an AI assistant
Typical output (text format):
changed files (1): src/etl/load_customers.py
Changed: func:src/etl/load_customers.py::load_customers risk HIGH (score 20.0)
├── ▤ prod.analytics.customer (table) via writes_to
│ └── ◆ dim_customer (dbt_model) via depends_on
│ └── ◆ fact_booking (dbt_model) via depends_on
│ ├── 📊 revenue_report (dashboard) via exposes
│ └── 📊 customer_dashboard (dashboard) via exposes
Notify: finance (revenue_report) · growth (customer_dashboard)
Recommended tests:
✓ pytest -k load_customers
✓ dbt build --select dim_customer+ fact_booking+
✓ Manually validate 'revenue_report' after deploy
check options: --base/--head, --code DIR (code root if not the repo root), --graph FILE / --save-graph FILE --update,
every datagraph build input (--dbt-manifest --dbt-catalog --sql --airflow --lambda --js --warehouse --openlineage --lineage-file --datahub),
--max-depth, --no-inferred (artifact-backed edges only), --format text|json|markdown, --html FILE, --fail-on LEVEL, -o FILE.
GitHub Action — a comment on every PR
# .github/workflows/impact.yml
name: change impact
on: pull_request
permissions: { contents: read, pull-requests: write }
jobs:
impact:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- uses: actions/setup-python@v5
with: { python-version: "3.12" }
- uses: sumit-gupta03/impactgraph@main
with:
repo-path: src
dbt-manifest: target/manifest.json
fail-on: CRITICAL # LOW | MEDIUM | HIGH | CRITICAL | NONE
The action installs impactgraph, diffs the PR against its base, posts the Markdown report as a PR comment
(and to the job summary) and exposes level as an output.
Python API
from impactgraph import check, to_markdown
result = check(".", base="origin/main", inputs={"dbt_manifest": "target/manifest.json"})
print(result.level, result.score, result.changed_files)
print(result.analysis.recommended_tests, result.analysis.owners)
print(to_markdown(result)) # the PR comment
assert not result.breaches("HIGH")
Everything from datagraph is re-exported (from impactgraph import ImpactGraph, analyze_impact, DbtExtractor, ...).
How it works (and why it is trustworthy)
- Deterministic graph — built from artifacts only (AST, manifests, SQL parse, metadata, git). No LLM builds nodes.
- Typed edges with an impact direction —
contains,writes_to,exposesflow forward;calls,imports,depends_onflow backward — so a change propagates the way reality does. - Provenance — every edge is
extracted,inferredorllm;--no-inferreddrops heuristics. - Diff → function — changed line ranges map to the exact functions/models touched, not whole files.
- Risk, owners, tests — a weighted score over affected node types (dashboards and tables weigh more), owners collected from dbt/DataHub metadata, test suggestions per node type.
- AI only explains —
impactgraph explain ...(optional[ai]) narrates the result; it never changes it.
Use it from AI coding assistants
Copy skills/impactgraph/ to .claude/skills/impactgraph/ (or ~/.claude/skills/) and ask
"is this change safe?", "what breaks if I change load_customers?". For MCP, the knowledge base
(wiki, context) and data analysis (relationships, profile) use datagraph directly.
impactgraph vs datagraph
| impactgraph | datagraph | |
|---|---|---|
| Audience | developers, reviewers, CI | data engineers, analysts, AI-assistant builders |
| Question | will this PR break something? | where does this data come from, how is it related, what does it look like, give my assistant the context |
| Ships | check / pr CLI, GitHub Action, skill; passes everything else through |
the engine: extractors, lineage, relationships, profiling, wiki/context, MCP, plugins |
| Graph & node ids | identical — a graph built by one is readable by the other |
Security
impactgraph inherits datagraph's security model (deterministic core, LLM only explains, prompts wrap repo/warehouse text as
untrusted data, DSN passwords never stored or logged, profiling masks sensitive columns, quoted identifiers, escaped HTML).
The PR comment is plain Markdown built from node names in your repository; the GitHub Action needs only pull-requests: write
and the default GITHUB_TOKEN. See the datagraph security notes.
Development
git clone https://github.com/sumit-gupta03/impactgraph && cd impactgraph
pip install -e ".[dev]" # pulls datagraph-core from PyPI (the engine; import name datagraph)
pytest
History: versions ≤ 0.5 of this repository contained the whole engine; it now lives in datagraph and impactgraph (≥ 0.6) is the thin PR-focused layer.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file impactgraph-0.7.1.tar.gz.
File metadata
- Download URL: impactgraph-0.7.1.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8726588f57bbf217d8fce85e2c9090e4e005b4859d390f0248c19ea4f4aa0543
|
|
| MD5 |
153b9bdc1b6966eea963494d849d7ab1
|
|
| BLAKE2b-256 |
a52a7a1cf06f49a5657ffd5760c6d8a0cd44b742a7154845c86077cf201c87ec
|
Provenance
The following attestation bundles were made for impactgraph-0.7.1.tar.gz:
Publisher:
publish.yml on sumit-gupta03/impactgraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
impactgraph-0.7.1.tar.gz -
Subject digest:
8726588f57bbf217d8fce85e2c9090e4e005b4859d390f0248c19ea4f4aa0543 - Sigstore transparency entry: 2569430933
- Sigstore integration time:
-
Permalink:
sumit-gupta03/impactgraph@f9b9590e63a956d31ce47de54d7a5fcf78a506bd -
Branch / Tag:
refs/tags/v0.7.1 - Owner: https://github.com/sumit-gupta03
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f9b9590e63a956d31ce47de54d7a5fcf78a506bd -
Trigger Event:
push
-
Statement type:
File details
Details for the file impactgraph-0.7.1-py3-none-any.whl.
File metadata
- Download URL: impactgraph-0.7.1-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad303954d47b83bec4b02dcfa3bbab9e318b2264cf01537f8db6de43b937a4bd
|
|
| MD5 |
33310090e193e3895ab1e089039eac35
|
|
| BLAKE2b-256 |
b9fac36433d4618442ad15cdceae5e844e835132236866884bf606a00aa5407b
|
Provenance
The following attestation bundles were made for impactgraph-0.7.1-py3-none-any.whl:
Publisher:
publish.yml on sumit-gupta03/impactgraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
impactgraph-0.7.1-py3-none-any.whl -
Subject digest:
ad303954d47b83bec4b02dcfa3bbab9e318b2264cf01537f8db6de43b937a4bd - Sigstore transparency entry: 2569430946
- Sigstore integration time:
-
Permalink:
sumit-gupta03/impactgraph@f9b9590e63a956d31ce47de54d7a5fcf78a506bd -
Branch / Tag:
refs/tags/v0.7.1 - Owner: https://github.com/sumit-gupta03
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f9b9590e63a956d31ce47de54d7a5fcf78a506bd -
Trigger Event:
push
-
Statement type: