Beta. The Airflow provider is new. Core functionality is stable, but field
names and operator arguments may evolve based on feedback.
airflow-provider-datris package ships an operator
that triggers a Datris tap, waits for the resulting pipeline to reach a terminal
state, streams Datris logs into the Airflow task log, and surfaces run tokens and
metrics as XComs.
No execution moves into Airflow — it only triggers and observes. If you don’t run
Airflow, nothing changes: Datris’s built-in scheduler keeps working as before.
Install
Configure a connection
Add a connection of type Datris in the Airflow UI (or via env var / CLI):
When is the API key required?
- Local / single-tenant with
useApiKeys=false(default): leave the password blank — the header is ignored. - Single-tenant with
useApiKeys=true, or a hosted/multi-tenant install: set the password to an API key that holds thetap:runcapability for the taps you trigger.
Trigger a tap
- Calls
POST /tap/runwithmode=run. - Polls
GET /pipeline/status?publishertoken=...&withrollup=trueto a terminal state. - Streams Datris log lines into the Airflow task log on each poll.
- Pushes
publisher_token,pipeline_tokens, and final metrics (row_count,duration_ms) as XComs. - On Airflow task timeout or DAG cancellation, calls
POST /job/killso the Datris job transitions toCANCELLED.
Date-windowed backfills
Pass per-run params viatap_params (named to avoid Airflow’s reserved
params attribute). Each value is exposed to the tap script as an environment
variable, so the script can read a run-specific window. Values are
Jinja-templated by Airflow:
os.environ["since"]).
One scheduler at a time
A tap should be scheduled by either Datris or Airflow — never both, or it fires twice. The rule is simple and based on the tap’s cron:- Tap has a cron schedule → Datris’s built-in scheduler owns it. The operator refuses to trigger it and fails the task, so you can’t accidentally double-fire.
- Tap has no cron (manual-only) → Airflow owns scheduling. The operator triggers it normally.
Retries and idempotency
Datris debounces rapid duplicatemode=run calls for the same tap. If a retry
lands inside the debounce window, /tap/run returns
status="skipped", persistedReason="debounced". The operator treats this as
success with a warning — the in-flight run is the real one, and failing the
task would mask it.
