-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Conversation
tests/operators/test_python.py
Outdated
@mock.patch("airflow.operators.python.importlib") | ||
def test_virtuenv_not_installed(self, importlib): | ||
importlib.util.find_spec.return_value = None | ||
with pytest.raises(AirflowException): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
91e4838
to
ce03d87
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, LGTM
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).
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).
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)
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.