Skip to main content

41 posts tagged with "Apache Airflow"

Apache Airflow®, the Open-Source Platform to Write, Schedule and Monitor Data Pipelines as Python Code

View All Tags

How to Run a Bash Command in Apache Airflow® with BashOperator

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

Plenty of pipeline steps are already shell commands: compress a file, run a script, call a command-line tool. In Apache Airflow®, BashOperator runs one as a task. Airflow starts bash with your command, writes everything it prints to the task log, and uses its exit code to decide whether the task succeeded. This guide runs one echo command on Airflow 3.4.0 and reads its log.

How to Chain Tasks with chain() in Apache Airflow®

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

Writing a >> b >> c >> d gets long once an Apache Airflow® Dag has many steps. chain() takes the tasks in order and sets the same dependencies in one call. It also does something >> can't: give it two lists of the same length next to each other and it pairs them up, first with first and second with second. This guide builds a six-task Dag with chain() on Airflow 3.4.0.

How to Set Task Dependencies with Bitshift Operators (>> and <<) in Apache Airflow®

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

In Apache Airflow®, a Dag's tasks run in the order you set between them. a >> b says a runs before b, and b << a says the same thing from the other side. Put tasks in a list and they all get the same place in the order, so they can run side by side. This guide sets the order of a four-task Dag on Airflow 3.4.0 and checks it in a real run.

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

· 20 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.

Fixed: "The HMAC key is 24 bytes long, which is below the minimum recommended length of 64 bytes for SHA512" in Apache Airflow®

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

A fresh Apache Airflow® 3.4.0 installation printed the same warning four times while I signed in and ran one Dag: The HMAC key is 24 bytes long, which is below the minimum recommended length of 64 bytes for SHA512. The key in question is the secret Airflow signs its access tokens with, and the one it generates for you is too short. Here's how I traced it, and the one setting that fixes it.

Fixed: "Bundle 'dags-folder' path does not exist … This may cause DAG loading issues" in Apache Airflow®

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

The first start of Apache Airflow® in a new folder went fine until the Dag processor printed a warning: Bundle 'dags-folder' path does not exist, followed by Found 0 files. Nothing was broken yet, but Airflow had nowhere to look for Dags. The fix is one mkdir, and this post shows how I found that out.

How to Keep Apache Airflow® Files Out of Git with .gitignore

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

When AIRFLOW_HOME is your project folder, Apache Airflow® writes its own files next to your code: a settings file with generated secrets, a database, logs and a file with the admin password. None of them belong in Git, and two of them are secrets. A .gitignore keeps them out before your first commit. This guide writes one on Airflow 3.4.0 and checks that it works.

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.