Airflow subdag codeview shows code of main-dag

Viewed 279

I am new to Airflow and I followed the tutorial on the official page (https://airflow.readthedocs.io/en/stable/tutorial.html)
and added a subdag to the tutorial dag. When I zoom into the subdag on the web-UI and click on code, the code of the main-dag is shown. Also when I click on details of the subdag the filename of the main-dag is displayed, like on the screenshot.

Screenshot of wrong filepath: Screenshot of wrong filepath

My file structure:

dags/
├── subdags
│   ├── hellosubdag.py
│   ├── __init__.py
├── tutorial.py

My main-dag code:

from datetime import timedelta

from airflow import DAG

from airflow.operators.bash_operator import BashOperator
from airflow.operators.subdag_operator import SubDagOperator
from airflow.utils.dates import days_ago
from subdags.hellosubdag import sub_dag

default_args = {
    'owner': 'airflow',
    'depends_on_past': False,
    'start_date': days_ago(2),
    'retries': 1,
    'retry_delay': timedelta(minutes=5),
}
parentdag = DAG(
    dag_id='tutorial',
    default_args=default_args,
    description='A simple tutorial DAG',
    schedule_interval=timedelta(days=1),
)

subdag_execute = SubDagOperator(
    task_id='subdag-exe',
    subdag=sub_dag('tutorial', 'subdag-exe', default_args['start_date'], timedelta(days=1)),
    dag=parentdag,
)

And the subdag simply prints a string.

My company was using airflow 1.10.3 before updating to 1.10.9 and I've been told that it used to work before the update.

I can't find any changelog or documentation regarding this issue, was this feature removed at some point or am I doing something wrong?

0 Answers
Related