Hackathon Submission: DataHub Impact Analyzer

Inspiration

Every data engineer knows the sinking feeling of dropping a database column or altering a data type, only to get an emergency Slack message 20 minutes later because an executive dashboard broke or a critical ETL pipeline crashed.

In modern data stacks with hundreds of interconnected tables, pipelines, and dashboards, tracking downstream dependencies manually is nearly impossible. Existing tools offer visual lineage graphs, but they don't proactively analyze schema changes or explain the risks in plain English. We wanted to build a pre-flight safety check for database changes -- a tool that prevents production data incidents before the code is ever deployed.

What it does

DataHub Impact Analyzer tells data engineers exactly what will break before they execute a schema change.

  1. Input Change: Enter a target table URN and a proposed schema modification (e.g., DROP COLUMN user_id or ALTER COLUMN amount TYPE DECIMAL).
  2. Lineage Discovery: Leverages DataHub's lineage graph to fetch every dataset, pipeline, and dashboard downstream of that table.
  3. Impact & Severity Engine: Classifies affected assets into clear, actionable risk tiers:
    • CRITICAL: Executive and user-facing dashboards
    • HIGH: Data pipelines and ETL jobs
    • LOW: Downstream intermediate tables
  4. AI-Powered Explanations: Uses GPT-4o-mini (backed by a rich, zero-downtime template fallback) to generate plain-English summaries of what will break, why it matters, and recommended next steps.
  5. Ownership Tracking: Resolves asset owners directly from DataHub, so engineers know exactly who to warn before deploying changes.

How we built it

We designed a clean, modular 5-step pipeline architecture:

  • Backend: Built with Python 3.11 and FastAPI, leveraging pydantic-settings for config management and dependency injection (lru_cache singletons) for high-performance request handling.
  • DataHub Integration: Implemented the official acryl-datahub Python SDK to query DataHubGraph relationships (DownstreamOf) and fetch ownership metadata. We also included a toggleable mock mode for standalone hackathon demos.
  • Schema Parser: Built a regex-based parser to normalize and validate SQL schema operations (DROP COLUMN, ADD COLUMN, ALTER COLUMN).
  • AI Agent: Integrated OpenAI's gpt-4o-mini to translate technical lineage metadata into actionable insights for both technical and non-technical stakeholders.
  • Frontend: Crafted a responsive, glassmorphic dark-mode interface using vanilla HTML5, CSS3 gradients, and JavaScript.
  • Testing & DevOps: Developed 38 unit and integration tests using pytest and httpx, and fully containerized the application with Docker Compose.

Challenges we ran into

  • Navigating DataHub's SDK: Learning the DataHub Python SDK and semi-typed entity models from scratch within a tight hackathon timeline required deep-diving into metadata schemas.
  • Designing a Deterministic AI Architecture: Early on, we realized that relying purely on LLMs for dependency analysis could cause hallucinations. We solved this by making the impact analysis 100% deterministic via DataHub lineage, reserving the LLM strictly as a natural language explainer.
  • Zero-Downtime Resilience: Ensuring the application functions seamlessly without an OpenAI API key or an active DataHub instance required designing robust, multi-tier fallback chains.

Accomplishments that we're proud of

  • DataHub is Essential: We created a tool where DataHub isn't an afterthought -- it is the core dependency that makes impact analysis possible.
  • Comprehensive Testing: Built a robust suite of 38 automated tests covering schema parsing, input validation, severity classification, and API contracts.
  • Foolproof Resilience: Designed the application to degrade gracefully. It works out-of-the-box via docker-compose up without requiring external API keys or live servers.
  • Clean Architecture: Delivered modular, type-safe, and well-documented code (~2,300 lines of code & docs combined) with a clear separation of concerns.

What we learned

  • The true power of DataHub's lineage graph as an analytical metadata layer, rather than just a visualization tool.
  • How to structure hybrid AI applications where core business logic remains deterministic while LLMs enhance human readability and developer UX.
  • Best practices in FastAPI dependency injection, custom middleware for browser caching (Cache-Control), and robust Pydantic v2 field validation.

What's next for DataHub Impact Analyzer

  • Column-Level Lineage: Deepen DataHub integration to parse SQL queries and verify column-level references for surgical impact precision.
  • Visual Graph Rendering: Embed an interactive D3.js or Mermaid graph visualization directly into the frontend result card.
  • MCP Server Integration: Expose the impact analysis engine as a Model Context Protocol (MCP) server so AI coding assistants (like Cursor or Claude) can check schema changes automatically during code edits.
  • CI/CD GitHub Action: Package the tool as a Pull Request check that runs automatically on migration scripts to block breaking changes before merge.

Built With

Share this project:

Updates