Visitar URL original
Error earlier if virtualenv is not installed and DAG has a PythonVirtualenvOperator by MatrixManAtYrService · Pull Request #15788 · apache/airflow · GitHub
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions airflow/operators/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import inspect
import os
import pickle
import shutil
import sys
import types
import warnings
Expand Down Expand Up @@ -325,6 +326,8 @@ def __init__(
"Passing op_args or op_kwargs is not supported across different Python "
"major versions for PythonVirtualenvOperator. Please use string_args."
)
if not shutil.which("virtualenv"):
raise AirflowException('PythonVirtualenvOperator requires virtualenv, please install it.')
super().__init__(
python_callable=python_callable,
op_args=op_args,
Expand Down