Skip to content

Circular dependency issue when trying to locally test DAG #34558

Closed as not planned

Description

@drobert-bfm

Apache Airflow version

2.7.1

What happened

Attempting to test DAG sanity by running dag.test():

if name == 'main':
test_http_sensor().test()

python my_sensor_dag.py

I receive the following error:

ImportError: cannot import name 'Dataset' from partially initialized module 'airflow'

What you think should happen instead

According to what I can figure out in the documentation, it should be possible to run DAG.test() outside the airflow scheduler/executor in order to validate a DAG.

How to reproduce

  1. Activate .venv which contains Airflow execution
  2. create dag with if name == 'main' as shown above
  3. run the code: python .py

Operating System

CentOS 8 Stream

Versions of Apache Airflow Providers

apache-airflow-providers-common-sql==1.7.1
apache-airflow-providers-ftp==3.5.1
apache-airflow-providers-http==4.5.1
apache-airflow-providers-imap==3.3.1
apache-airflow-providers-mysql==5.3.1
apache-airflow-providers-sqlite==3.4.3

Deployment

Virtualenv installation

Deployment details

No response

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. boring-cyborg commented on Sep 22, 2023

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

  2. Taragolis commented on Sep 22, 2023

    @Taragolis
    Contributor

    Unfortunetly we need a bit more details (full error stack trace) and DAG sample for able to reproduce and understand what going wrong.

  3. deleted a comment from f0restron07 on Sep 24, 2023
  4. github-actions commented on Oct 9, 2023

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has been open for 14 days with no response from the author. It will be closed in next 7 days if no further activity occurs from the issue author.

  5. added
    staleStale PRs per the .github/workflows/stale.yml policy file
    on Oct 9, 2023
  6. github-actions commented on Oct 16, 2023

    @github-actions
    Contributor

    This issue has been closed because it has not received response from the issue author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corekind:bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yetpending-responsestaleStale PRs per the .github/workflows/stale.yml policy file

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions