You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/10/28 03:04:02 UTC

[GitHub] [airflow] rkarish opened a new issue, #27338: scripts/tools/initialize_virtualenv.py calling .exists() on str

rkarish opened a new issue, #27338:
URL: https://github.com/apache/airflow/issues/27338

   ### Apache Airflow version
   
   main (development)
   
   ### What happened
   
   While setting up a local development environment I went to use the `scripts/tools/initialize_virtualenv.py ` script and received an exception. I believe this should be `os.path.exists(airflow_home)` instead.
   
   ```
   Traceback (most recent call last):
     File "/Users/rkarish/Projects/airflow/scripts/tools/initialize_virtualenv.py", line 187, in <module>
       main()
     File "/Users/rkarish/Projects/airflow/scripts/tools/initialize_virtualenv.py", line 142, in main
       clean_up_airflow_home(airflow_home_dir)
     File "/Users/rkarish/Projects/airflow/scripts/tools/initialize_virtualenv.py", line 36, in clean_up_airflow_home
       if airflow_home.exists():
   AttributeError: 'str' object has no attribute 'exists'
   ```
   
   Also `LOCAL_VIRTUALENV.rst` has an incorrect path to this file.
   
   ### What you think should happen instead
   
   _No response_
   
   ### How to reproduce
   
   _No response_
   
   ### Operating System
   
   macOS 13.0
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] 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


[GitHub] [airflow] rkarish closed issue #27338: scripts/tools/initialize_virtualenv.py calling .exists() on str

Posted by GitBox <gi...@apache.org>.
rkarish closed issue #27338: scripts/tools/initialize_virtualenv.py calling .exists() on str
URL: https://github.com/apache/airflow/issues/27338


-- 
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] rkarish commented on issue #27338: scripts/tools/initialize_virtualenv.py calling .exists() on str

Posted by GitBox <gi...@apache.org>.
rkarish commented on issue #27338:
URL: https://github.com/apache/airflow/issues/27338#issuecomment-1295682598

   Hi @o-nikolas, seems like it was intended to be a `Path` object like you said. I had a PR open with an approval but needed to move it to a branch in my fork so I opened another PR.


-- 
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 #27338: scripts/tools/initialize_virtualenv.py calling .exists() on str

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #27338:
URL: https://github.com/apache/airflow/issues/27338#issuecomment-1294388090

   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
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] o-nikolas commented on issue #27338: scripts/tools/initialize_virtualenv.py calling .exists() on str

Posted by GitBox <gi...@apache.org>.
o-nikolas commented on issue #27338:
URL: https://github.com/apache/airflow/issues/27338#issuecomment-1294435687

   Thanks for the bug report @rkarish!
   
   I've assigned you the task since you checked that you're willing to submit a PR :smiley: 
   
   >  I believe this should be os.path.exists(airflow_home) instead
   
   Looking at the function stub for `clean_up_airflow_home` it looks like that code is expecting a `Path` object, but it's getting a string. So I think the better fix is to update the calling code to pass in a Path object instead of a string as it is now. 
   


-- 
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] o-nikolas commented on issue #27338: scripts/tools/initialize_virtualenv.py calling .exists() on str

Posted by GitBox <gi...@apache.org>.
o-nikolas commented on issue #27338:
URL: https://github.com/apache/airflow/issues/27338#issuecomment-1295761268

   > Hi @o-nikolas, seems like it was intended to be a `Path` object like you said, thank you for pointing that out and assigning me the ticket. I had a PR open with an approval but needed to move it to a branch in my fork so I opened another PR for this.
   
   Thanks for putting up a PR! I've reviewed it and left a comment :) 


-- 
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