Skip to content

Fix venv detection for Python virtualenv operator#33223

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix-venv-detection
Aug 8, 2023
Merged

Fix venv detection for Python virtualenv operator#33223
potiuk merged 1 commit into
apache:mainfrom
potiuk:fix-venv-detection

Conversation

@potiuk

@potiuk potiuk commented Aug 8, 2023

Copy link
Copy Markdown
Member

This is a follow-up after #32939. It seems that findspec does not cover all the cases and the previous check is also faster.

Adding check for the binary first and then falling back to spec finding will make it faster and work in the cases where the findspec does not work (for local development cases).


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@jedcunningham jedcunningham left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also update example dags tutorial_taskflow_api_virtualenv.py and example_python_operator.py.

This is a follow-up after apache#32939. It seems that findspec does not
cover all the cases and the previous check is also faster.

Adding check for the binary first and then falling back to spec
finding will make it faster and work in the cases where the
findspec does not work (for local development cases).
@potiuk
potiuk force-pushed the fix-venv-detection branch from 4ab52aa to 4f448c4 Compare August 8, 2023 22:33
@potiuk

potiuk commented Aug 8, 2023

Copy link
Copy Markdown
Member Author

tutorial_taskflow_api_virtualenv

Ah ... now I understand why you insisted on extracting it :)

Done.

@potiuk
potiuk merged commit c4fe5b8 into apache:main Aug 8, 2023
@potiuk
potiuk deleted the fix-venv-detection branch August 8, 2023 23:59
@potiuk potiuk added this to the Airflow 2.7.0 milestone Aug 8, 2023
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Aug 9, 2023
ephraimbuddy pushed a commit that referenced this pull request Aug 9, 2023
This is a follow-up after #32939. It seems that findspec does not
cover all the cases and the previous check is also faster.

Adding check for the binary first and then falling back to spec
finding will make it faster and work in the cases where the
findspec does not work (for local development cases).

(cherry picked from commit c4fe5b8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants