Install & Compatibility
Where this runs
tested against v0.3.12 · 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
muslpy 3.10–3.940 runs
installs and imports cleanly · install 0.0s · import 12.410s · 42.4MB
glibcpy 3.10–3.940 runs
installs and imports cleanly · install 14.3s · import 11.828s · 61MB
50MB installed
● package 50MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
get_provider_info
✓ from airflow_mcd import get_provider_info
✗ from airflow_mcd.callbacks import mcd_callbacks
get_version
✓ from airflow_mcd import get_version
PackageNotFoundError
✓ from airflow_mcd import PackageNotFoundError
This quickstart demonstrates how to integrate Monte Carlo callbacks into an Apache Airflow DAG. The `mcd_callbacks.dag_callbacks` and `mcd_callbacks.task_callbacks` are used to automatically send webhooks to Monte Carlo upon various DAG and task events (success, failure, etc.), providing observability. For full functionality, Monte Carlo API credentials must be configured as an Airflow connection.
from __future__ import annotations
import pendulum
from airflow.models.dag import DAG
from airflow.operators.bash import BashOperator
from airflow_mcd.callbacks import mcd_callbacks
with DAG(
dag_id="monte_carlo_example_dag",
start_date=pendulum.datetime(2023, 1, 1, tz="UTC"),
catchup=False,
schedule=None,
tags=["monte_carlo", "example"],
**mcd_callbacks.dag_callbacks, # Apply broad DAG-level callbacks
) as dag:
start_task = BashOperator(
task_id="start_task",
bash_command="echo 'Starting DAG'",
**mcd_callbacks.task_callbacks, # Apply broad Task-level callbacks
)
process_data = BashOperator(
task_id="process_data",
bash_command="echo 'Processing data...'; sleep 5",
# You can override specific callbacks if needed:
# on_failure_callback=mcd_callbacks.mcd_task_failure_callback,
**mcd_callbacks.task_callbacks,
)
end_task = BashOperator(
task_id="end_task",
bash_command="echo 'DAG finished'",
**mcd_callbacks.task_callbacks,
)
start_task >> process_data >> end_task
Debug
Known issues
breakingWhen upgrading to Airflow 2.9.0 or later, ensure `airflow-mcd` is updated to version 0.3.3 or higher. Older versions of `airflow-mcd` are not compatible with Airflow 2.9.0+ and may cause connection failures.fixUpgrade `airflow-mcd` to 0.3.3 or later: `pip install -U airflow-mcd`.
affects: <0.3.3 (with Airflow >= 2.9.0)
gotchaIf task-level callbacks are configured, DAG-level callbacks (e.g., `mcd_callbacks.dag_callbacks`) must also be defined. Without DAG callbacks, Monte Carlo cannot update the DAG run status, leading to DAGs appearing perpetually 'Running' and preventing failure alerts.fixAlways include `**mcd_callbacks.dag_callbacks` (or explicit DAG callbacks) in your DAG definition if you are using any task-level callbacks.
affects: All
gotchaThe `Monte Carlo Data Gateway` connection type in Airflow does not support Circuit Breakers operations. For Circuit Breaker functionality, you must use the `Monte Carlo Data` connection type configured with an API Key ID (login) and API Secret (password).fixCreate an Airflow connection of type `Monte Carlo Data` for Circuit Breakers, ensuring the API Key ID is in the 'Login' field and the API Secret in the 'Password' field.
affects: All
breakingFor Airflow 3.0 compatibility, `airflow-mcd` package version 0.3.10 and later is required. Earlier versions of `airflow-mcd` may not function correctly with Airflow 3.0 onwards.fixUpgrade `airflow-mcd` to 0.3.10 or later: `pip install -U airflow-mcd`.
affects: <0.3.10 (with Airflow >= 3.0)
Upgrade
Version history
0.3.12latest on PyPI · released May 7, 2026
Audit
Dependencies
apache-airflowrequiredThis package is an Apache Airflow provider, requiring Airflow for functionality.