Registry / data / dagster-pandera

dagster-pandera

JSON →
library0.29.9pypypi✓ verified 84d ago

dagster-pandera provides an integration layer to use Pandera for data validation within Dagster data pipelines. It allows defining Pandera schemas for Dagster assets, ensuring data quality and correctness before data is consumed by downstream assets. The current version is 0.29.0, released in sync with Dagster core, which has a frequent release cadence, often multiple patch releases per week.

pip install dagster-pandera
INSTALL
IMPORT
SIG · DAGSTER-PANDERA
D
dagster-pandera
datapythonv0.29.9
Install
19.1s avg
Import
Disk
285MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.29.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.915 runs
installs and imports cleanly · install 0.0s · import 0.000s · 276.2MB
glibc
py 3.103.915 runs
installs and imports cleanly · install 19.1s · import 0.000s · 264MB
285MB installed
● package 285MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DagsterPanderaSchema
from dagster_pandera import DagsterPanderaSchema
from dagster_pandera import pandera_schema_asset

This quickstart defines a `pandera.DataFrameSchema` and then uses the `pandera_schema_asset` decorator to apply this schema to a Dagster asset. If the DataFrame returned by `validated_data` does not conform to `my_dataframe_schema`, the asset materialization will fail, preventing invalid data from proceeding to `downstream_asset`. The example also shows how to define a simple Dagster job and schedule.

import pandas as pd import pandera as pa from dagster import Definitions, asset, ScheduleDefinition, JobDefinition from dagster_pandera import pandera_schema_asset # 1. Define a Pandera DataFrameSchema my_dataframe_schema = pa.DataFrameSchema( columns={ "id": pa.Column(int, pa.Check.ge(0)), "name": pa.Column(str, pa.Check.str_length(min_value=1)), "value": pa.Column(float) }, strict=True, # Ensure no extra columns are present index=pa.Index(int, name="record_index") ) # 2. Define a Dagster asset using the pandera_schema_asset decorator @pandera_schema_asset(schema=my_dataframe_schema) def validated_data() -> pd.DataFrame: """ An asset that produces a DataFrame and validates it against my_dataframe_schema. If validation fails, the asset materialization will error. """ # Simulate data production data = { "id": [1, 2, 3], "name": ["Alice", "Bob", "Charlie"], "value": [10.1, 20.2, 30.3] } df = pd.DataFrame(data, index=[100, 101, 102]) return df @asset def downstream_asset(validated_data: pd.DataFrame): """ This asset consumes the validated data, guaranteed to conform to the schema. """ print(f"Downstream asset received validated data with {len(validated_data)} rows.") # Further processing with the validated DataFrame return validated_data['value'].sum() # 3. Define the Dagster repository with assets and an example job my_job = JobDefinition(name="my_validation_pipeline", assets=[validated_data, downstream_asset]) defs = Definitions( jobs=[my_job], schedules=[ ScheduleDefinition( job=my_job, cron_schedule="0 0 * * *", # Run daily at midnight name="daily_validation_schedule" ) ] )
Debug
Known issues
breakingVersion Mismatch with Dagster Core: `dagster-pandera`'s version is tightly coupled with `dagster` core's minor and patch versions. Upgrading `dagster` without also upgrading `dagster-pandera` (or vice-versa) can lead to unexpected behavior, `ImportError`s, or runtime crashes.
fix
Always upgrade `dagster` and all `dagster-*` libraries in unison to their latest compatible versions. Use `pip install dagster dagster-pandera --upgrade` or ensure versions align in your `requirements.txt`.
affects: <0.29.0
gotchaSchema Strictness: By default, `pandera.DataFrameSchema` might not enforce that *only* the specified columns are present (i.e., it might allow extra columns). If you need to strictly enforce the column set, you must explicitly set `strict=True` in your schema definition.
fix
When defining `pa.DataFrameSchema`, include `strict=True` to prevent unexpected extra columns from passing validation: `pa.DataFrameSchema(..., strict=True)`.
affects: All versions
gotchaPerformance with Large Datasets: Validating very large DataFrames (e.g., millions of rows) with complex Pandera schemas can be CPU and memory intensive, potentially increasing asset run times. Consider the impact on your pipeline performance.
fix
For extremely large datasets, consider strategies like sampling, partial validation, or optimizing your Pandera checks. Ensure adequate compute resources are allocated for validation steps.
affects: All versions
Upgrade
Version history
0.29.9latest on PyPI · released Jun 11, 2026
Audit
Dependencies
dagsterrequiredCore Dagster library, version tightly coupled.
panderarequiredData validation library used for schema definitions.
Agent activity
22 hits · last 30 days
node
20
OpenAI (training)
1
Resources
dagster-pandera — pip install dagster-pandera · libregistry