Skip to content

Dag created with a dag decorator in a packaged dag file (zip) has incorrect filepath property #15147

@mejran

Description

@mejran

Apache Airflow version: 2.0.1

Kubernetes version (if you are using kubernetes) (use kubectl version): 1.19.6

Environment:

  • Cloud provider or hardware configuration: AWS EKS
  • OS (e.g. from /etc/os-release): Debian
  • Kernel (e.g. uname -a): 5.4.95-42.163.amzn2.x86_64
  • Install tools:
  • Others:

What happened:

If a dag decorator is used in a packaged dag (zip file) then the filepath for that dag is not correct but rather it points to the airflow package's dag.py file on the local filesystem. This breaks the KubernetesExectutor as the directory passed to its LocalExecutor is incorrect.

What you expected to happen:

The filepath to point to the zip file path (ie: /opt/airflow/dags/package.zip#dags.py).

How to reproduce it:

  • Create a dag decorator based dag:
@dag()
def bad():
    pass
  • Deploy this dag in a packaged zip

  • Check the filepath property in the UI.

Anything else we need to know:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions