You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "drobert-bfm (via GitHub)" <gi...@apache.org> on 2023/09/22 12:47:20 UTC

[GitHub] [airflow] drobert-bfm opened a new issue, #34558: Circular dependency issue when trying to locally test DAG

drobert-bfm opened a new issue, #34558:
URL: https://github.com/apache/airflow/issues/34558

   ### 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 <name of dag file>.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
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Circular dependency issue when trying to locally test DAG [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #34558:
URL: https://github.com/apache/airflow/issues/34558#issuecomment-1752202138

   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Taragolis commented on issue #34558: Circular dependency issue when trying to locally test DAG

Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on issue #34558:
URL: https://github.com/apache/airflow/issues/34558#issuecomment-1731602878

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Circular dependency issue when trying to locally test DAG [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #34558: Circular dependency issue when trying to locally test DAG
URL: https://github.com/apache/airflow/issues/34558


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Circular dependency issue when trying to locally test DAG [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #34558:
URL: https://github.com/apache/airflow/issues/34558#issuecomment-1763548102

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] f0restron07 commented on issue #34558: Circular dependency issue when trying to locally test DAG

Posted by "f0restron07 (via GitHub)" <gi...@apache.org>.
f0restron07 commented on issue #34558:
URL: https://github.com/apache/airflow/issues/34558#issuecomment-1732504907

   Hi @drobert-bfm,
   
   Thank you for providing the details of the issue you’re encountering with Apache Airflow 2.7.1. I understand that you are facing an ImportError when trying to test a DAG outside the Airflow scheduler/executor.
   
   Here are a few suggestions and questions that might help in resolving the issue:
   
   Check Import Statements:
   Ensure that you are importing the 'Dataset' class from the correct module and there are no circular or incorrect import statements in your script.
   
   Verify Airflow Initialization:
   Ensure that Airflow is correctly installed, configured, and fully initialized before running the script. There might be a missing configuration or incorrect installation causing the module to be partially initialized.
   
   Consult Specific Version Documentation:
   Please refer to the documentation for version 2.7.1 of Airflow to check for any deprecations or changes related to importing modules or classes.
   
   Inspect Virtual Environment Setup:
   Verify that your virtual environment is correctly set up and isolated, containing the right package versions, to avoid any package conflicts and errors.
   
   Additional Details:
   Could you provide more details on your code, specifically around where and how you are trying to import the 'Dataset' class? Any additional details on your environment setup might also be helpful in diagnosing the issue more accurately.
   
   If the issue persists after trying the above suggestions, please consider seeking more help from the Apache Airflow community forums or discussion groups, where you might find others who have encountered similar issues.
   
   I hope this helps in resolving your issue. If you manage to identify the problem and find a solution, please consider contributing back by submitting a PR, as you mentioned, following Apache Airflow’s contribution guidelines.
   
   Best Regards,
   f0restron
   
   
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] boring-cyborg[bot] commented on issue #34558: Circular dependency issue when trying to locally test DAG

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #34558:
URL: https://github.com/apache/airflow/issues/34558#issuecomment-1731356355

   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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org