New to Kestra?
Use blueprints to kickstart your first workflows.
Validate data quality and enforce data contracts using the Pandera library inside a Python Script task.
This flow runs a Pandera schema validation inside a Python Script task. Define a typed, rule-based schema once, Pandera checks every column, constraint, and data-type expectation on every run and halts the pipeline before bad data reaches any downstream system.
Schedule trigger starts the flow at 09:00 every morning.validate_data (io.kestra.plugin.scripts.python.Script, python:3.11-slim) installs pandas and pandera via dependencies, then:pa.DataFrameSchema that names every expected column, its Python type, and any value-level checks (e.g. price > 0, inventory >= 0).schema.validate(data, lazy=True) so all failing columns are reported at once rather than stopping at the first error.failure_cases DataFrame and exits with code 1, which marks the task, and the execution, as FAILED.parallel_post_processing (io.kestra.plugin.core.flow.Parallel) only runs when validation passes, firing success_notification and trigger_downstream_etl simultaneously. Replace the Log tasks with real notifications (Slack, email) or downstream flow triggers.Data engineers and analytics engineers who want a lightweight, code-native quality gate before a dbt run, a warehouse load, or any batch pipeline, without standing up a separate quality platform.
dependencies field keeps the container image minimal: Pandera is installed on demand, pinned per flow, and isolated from other tasks.io.kestra.plugin.core.flow.If.python:3.11-slim image).Add secrets when replacing the inline data with a real source, for example:
POSTGRES_URL, POSTGRES_USER, POSTGRES_PASSWORD, to query a database.AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, to download a file from S3.Data Quality Check Passed! in the Logs.price value to -0.5 and run again. Pandera reports the failure case and the execution fails, so nothing downstream runs.data = pd.DataFrame(…) block with your real data source and update the schema columns and checks to match.cron expression on the daily trigger to fit your schedule.io.kestra.plugin.core.flow.If after validate_data to branch on outputs.validate_data.exitCode and send a Slack or email alert on failure.inputFiles so non-engineers can update column rules without touching the flow.validate_data tasks (one per table) inside a io.kestra.plugin.core.flow.Parallel block to validate an entire dataset family in one execution.dependencies (e.g. pandera==0.20.4) for reproducible results across environments.