Taragolis commented on code in PR #34359:
URL: https://github.com/apache/airflow/pull/34359#discussion_r1325773311
##########
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 removed for PythonVirtualenvOperator. "
+ "Since Python 3.10 is interpreted as 3.1. "
+ "Please use string value instead."
+ )
Review Comment:
I guess it is edge case with Python 3.1, I'm not sure that something below
3.3 in 3.x series would ever been stable for production usage. So warning would
be enough.
--
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]