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 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

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

How to Change the Port and Host of the Apache Airflow® API Server

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

Apache Airflow® serves its UI and REST API from the API server, on port 8080 and on every network address of your computer by default. Port 8080 is a popular one, so it's often taken by another program, and "every address" is more than a local setup needs. Two settings in the [api] section of airflow.cfg change both. This guide moves the API server to 127.0.0.1:8086 on Airflow 3.4.0.

How to Set AIRFLOW_HOME for Apache Airflow®

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

Apache Airflow® keeps everything it creates in one folder: its settings file, its database, its logs and the admin password. Unless you tell it otherwise, that folder is ~/airflow in your home folder, shared by every project. The AIRFLOW_HOME environment variable points Airflow at a folder of your choice instead. This guide shows both, on Airflow 3.4.0.

How to Start Apache Airflow® on Your Computer with airflow standalone

· 8 min read
Jagdish Kumawat
Founder @ Dewiride

Apache Airflow® runs as several programs that work together: a web server for the UI, a scheduler, a process that reads your Dag files, and more. airflow standalone starts all of them with one command and sets up a local database and an admin user on the way, which makes it the quickest way to try Airflow on your own computer. This guide starts it, opens the UI and stops it again, on Airflow 3.4.0.