To easily understand the examples and follow along with the code, it may be helpful to debug the DAGs execution and take advantage of IntelliSense to access the Airflow documentation and implementation.
This can be done using VSCode by following these steps:
- Create a Virtual Environment
- Install Airflow locally
( Before running the official script, you can define the root folder with
export AIRFLOW_HOME=/home/user/my_airflow_folder
) - Make sure the selected Python Interpreter matches your virtual environment path (i.e: ./env/bin/python)
- Configure and run the debugger placing these settings in
.vscode/launch.json
:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "internalConsole",
"justMyCode": false,
"env": {
"AIRFLOW__CORE__EXECUTOR": "DebugExecutor",
"AIRFLOW__DEBUG__FAIL_FAST": "True"
}
}
]
}
-
Open any DAG from this repo and start by debugging pressing F5
-
Look for StackOverflow reference link in each DAG docs