Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix check if virtualenv is installed in PythonVirtualenvOperator #32939

Merged
merged 1 commit into from
Jul 30, 2023

Conversation

shahar1
Copy link
Contributor

@shahar1 shahar1 commented Jul 29, 2023

closes: #24783


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

@boring-cyborg boring-cyborg bot added the area:core-operators Operators, Sensors and hooks within Core Airflow label Jul 29, 2023
@mock.patch("airflow.operators.python.importlib")
def test_virtuenv_not_installed(self, importlib):
importlib.util.find_spec.return_value = None
with pytest.raises(AirflowException):
Copy link
Member

Choose a reason for hiding this comment

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

CAn you please add match= and add the message regexp?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

@hussein-awala hussein-awala left a comment

Choose a reason for hiding this comment

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

Looks good, LGTM

@hussein-awala hussein-awala added the type:bug-fix Changelog: Bug Fixes label Jul 29, 2023
@hussein-awala hussein-awala added this to the Airflow 2.6.4 milestone Jul 29, 2023
@potiuk potiuk merged commit ddcd474 into apache:main Jul 30, 2023
42 checks passed
@eladkal eladkal modified the milestones: Airflow 2.6.4, Airflow 2.7.0 Aug 1, 2023
potiuk added a commit to potiuk/airflow that referenced this pull request Aug 8, 2023
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 added a commit that referenced this pull request Aug 8, 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).
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)
@shahar1 shahar1 deleted the check-if-venv-installed branch June 12, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core-operators Operators, Sensors and hooks within Core Airflow type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check if virtualenv is installed fails
4 participants