My first airflow dag doesn't seem to run (not in the UI)

85 Views Asked by At

**After running my airflow dag :

  • The UI only has the admin by default dags even when i refresh
  • My dag doesn't appear when i airflow dags list

Pre config:

  • I created a venv with a python3.11.6 version for a folder named extract_load

The installation steps that i followed :

  1. In my terminal, i first activated my venv in the extract_load folder

  2. i run export AIRFLOW_HOME=~/airflow in my terminal

  3. then pip install "apache-airflow[celery]==2.7.3" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.7.3/constraints-3.11.txt"

  4. then airflow standalone

  5. Connect to localhost:8080 after entering my username and password generated with the airflow standalone command

(The doc that i used to install : https://airflow.apache.org/docs/apache-airflow/stable/start.html)

I then ran my airflow script that is located directly in my extract_load file:

#%%
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
import datetime as dt
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta

#%%
today = datetime.now().strftime("%Y-%m-%d")


default_args = {
    "owner": "example",
    "email": ["[email protected]"],
    "email_on_failure": True,
    "retries": 2,
    "retry_delay": timedelta(minutes=10),
    "start_date": datetime(2023,12,14) 
}

dag = DAG(
    dag_id = 'load_test',
    schedule_interval = None,
    default_args = default_args,
)

def test():
    hello = print('Hello')
    return hello

test_run= PythonOperator(
    task_id='hello_test',
    python_callable=test,
    dag=dag,
)

test_run  

Then i run the script, the script is working well (VScode doesn't return any mistake) but nothing happens

0

There are 0 best solutions below