ephraimbuddy commented on code in PR #34359:
URL: https://github.com/apache/airflow/pull/34359#discussion_r1325611917


##########
airflow/operators/python.py:
##########
@@ -547,14 +547,21 @@ def __init__(
     ):
         if (
             python_version
-            and str(python_version)[0] != str(sys.version_info.major)
+            and python_version[0] != str(sys.version_info.major)
             and (op_args or op_kwargs)
         ):
             raise AirflowException(
                 "Passing op_args or op_kwargs is not supported across 
different Python "
                 "major versions for PythonVirtualenvOperator. Please use 
string_args."
                 f"Sys version: {sys.version_info}. Venv version: 
{python_version}"
             )
+        if type(python_version) is float or type(python_version) is int:
+            raise TypeError(
+                "Passing numeric type(int, float) as python_version "
+                "has been deprecated for PythonVirtualenvOperator. "
+                "Since Python 3.10 is interpreted as 3.1. "
+                "Please use string value instead."
+            )

Review Comment:
   We should handle this in such a way that it's not a breaking change



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to