turbaszek commented on a change in pull request #9394:
URL: https://github.com/apache/airflow/pull/9394#discussion_r444023173



##########
File path: airflow/operators/python.py
##########
@@ -261,6 +265,14 @@ def __init__(  # pylint: disable=too-many-arguments
         *args,
         **kwargs
     ):
+        if (
+            not isinstance(python_callable, types.FunctionType) or
+            isinstance(python_callable, types.LambdaType) and 
python_callable.__name__ == "<lambda>"
+        ):
+            raise AirflowException('PythonVirtualenvOperator only supports 
functions for python_callable arg')
+        if python_version and str(python_version)[0] != 
str(sys.version_info[0]) and (op_args or op_kwargs):

Review comment:
       ```suggestion
           if python_version and str(python_version)[0] != 
sys.version_info.major and (op_args or op_kwargs):
   ```




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to