You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "kyeonghoon-kim (via GitHub)" <gi...@apache.org> on 2023/09/15 07:54:01 UTC

[GitHub] [airflow] kyeonghoon-kim commented on a diff in pull request #34359: Deprecate numeric type python version in PythonVirtualEnvOperator

kyeonghoon-kim commented on code in PR #34359:
URL: https://github.com/apache/airflow/pull/34359#discussion_r1326934670


##########
airflow/operators/python.py:
##########
@@ -555,6 +555,13 @@ def __init__(
                 "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:
+            warnings.warn(
+                "Passing numeric type(int, float) as python_version is deprecated. "
+                "Please use string value instead.",
+                RemovedInAirflow3Warning,
+                stacklevel=2,
+            )

Review Comment:
   I think current version is enough.
   
   should I have to change to this?
   
   If so, I think condition should be not (isinstance(python_version, str) or python_version is None) since if python_version is None, it is interpreted as system's python version.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org