Skip to main content

15 posts tagged with "Data Engineering"

Data Engineering, Building Pipelines That Collect, Move, Transform and Load Data Reliably

View All Tags

Apache Airflow® Tutorial for Data Pipelines in Python — Part 1: Install Airflow and Run Your First Dag

· 19 min read
Jagdish Kumawat
Founder @ Dewiride

A data pipeline that runs on a timer is easy to start and hard to trust: did last night's run work, what did it do, and can it run again for the day it missed? Apache Airflow® is built to answer those questions. This series builds a real pipeline with it, step by step, on your own computer. In Part 1 you install Airflow, start it, and run your first Dag: a task that counts yesterday's earthquakes worldwide.

How to Check the Health of Apache Airflow® with the Health Endpoint

· 4 min read
Jagdish Kumawat
Founder @ Dewiride

Apache Airflow® is several programs working together, and any one of them can stop while the UI still opens. The health endpoint answers one question for all of them: is each part alive? It needs no sign-in, so a script, a monitoring tool or you with curl can ask it. This guide asks it, and reads the answer field by field, on Airflow 3.4.0.

How to Get an Access Token for the Apache Airflow® REST API

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

Apache Airflow® 3 has a REST API for everything the UI does: list Dags, trigger runs, read logs. Most of its endpoints refuse a request that doesn't prove who's asking. With the simple auth manager that airflow standalone uses, the proof is a JWT access token, which you get by posting a username and password to /auth/token. This guide gets one and uses it, on Airflow 3.4.0.

How to Read a Task Log in the Apache Airflow® UI

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

Everything an Apache Airflow® task writes, through Python's logging or with a plain print(), ends up in that task's log. In the Airflow 3 UI, the log has numbered lines, collapsible groups and a filter by level. This guide opens one, finds a print() line that isn't where you'd expect it, and filters the log down to warnings, on Airflow 3.4.0.

How to Trigger a Dag from the Command Line with airflow dags trigger

· 4 min read
Jagdish Kumawat
Founder @ Dewiride

The Apache Airflow® UI has a Trigger button, but the terminal is often quicker, and it's the way to start a Dag from a script. airflow dags trigger creates a run of a Dag, and airflow dags list-runs shows how it went. This guide triggers a one-task Dag with both, on Airflow 3.4.0, including the step that keeps the run from waiting forever.

How to Write a Dag with the TaskFlow API in Apache Airflow®

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

In Apache Airflow®, a Dag is a workflow: a set of tasks and the order they run in. With the TaskFlow API, you write it as ordinary Python functions. @task turns a function into a task, and @dag turns a function into the Dag that holds them. Pass one task's result to another and Airflow works out both the order and the data hand-off. This guide writes a two-task Dag on Airflow 3.4.0 and runs it.

How to Read an Apache Airflow® Setting with airflow config get-value

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

Apache Airflow® reads each setting from several places: environment variables, airflow.cfg and its built-in defaults. airflow config get-value prints the one value it ends up using, which is the quickest way to check a setting before you start Airflow or while you debug it. This guide reads a few settings on Airflow 3.4.0, and shows a trap with names that don't exist.