dbt-pydantic-generator

Convert dbt SQL schemas into Pydantic models for Airflow validation.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/mporenta/airflow --skill dbt-pydantic-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dbt-pydantic-generator
Source: https://github.com/mporenta/airflow/tree/main/.claude/skills/dbt-pydantic-generator
Command: npx skills add https://github.com/mporenta/airflow --skill dbt-pydantic-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generate type-safe Pydantic BaseModel classes that map dbt SQL schemas to Airflow DAG data contracts, enabling runtime validation and IDE support.

Core Features & Use Cases

  • Generate Pydantic models directly from dbt schema outputs to enforce data contracts in DAGs.
  • Infer column names, data types, and nullability from dbt models, including JSON/VARIANT fields.
  • Provide helper methods (to_snowflake_dict, from_snowflake_row) and validators for seamless Airflow integration.

Quick Start

Run the generator against your dbt model path to produce a ready-to-use Pydantic model.

Frequently Asked Questions about dbt-pydantic-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Pydantic models from dbt schemas for Airflow data validation?

To generate Pydantic models from dbt schemas for Airflow data validation, run the generator against your dbt model path to produce ready-to-use BaseModel classes. It automatically infers column names, data types, and nullability to enforce type-safe data contracts in DAGs.

Can I use dbt-pydantic-generator with Snowflake VARIANT JSON fields in my DAGs?

Yes, you can handle Snowflake VARIANT JSON fields because the generator infers JSON and VARIANT column types from dbt models. It provides built-in helper methods like to_snowflake_dict and from_snowflake_row for seamless Airflow integration.

What is the best way to enforce data contracts across dbt model layers in Airflow?

The best way to enforce data contracts across dbt model layers in Airflow is generating strongly typed Pydantic models. The generator applies type inference and nullability handling across raw, base, clean, intermediate, fact, and dimension layers to enable runtime validation.

Do I need additional dependencies to use dbt-pydantic-generator for type-safe DAGs?

No additional dependencies are required to use dbt-pydantic-generator for type-safe DAGs. It operates standalone with no listed dependencies, directly converting dbt SQL schemas into Pydantic BaseModel classes with generated validators for IDE support.

Does the generated Pydantic model handle nullability for dbt column types?

Yes, the generated Pydantic model handles nullability for dbt column types. It implements column type inference and nullability handling from dbt schema outputs, ensuring runtime data validation correctly processes optional fields within Airflow DAGs.