ashb commented on code in PR #29723:
URL: https://github.com/apache/airflow/pull/29723#discussion_r1115729277


##########
airflow/operators/python.py:
##########
@@ -690,9 +689,11 @@ def _is_pendulum_installed_in_target_env(self) -> bool:
             return False
 
     def _get_airflow_version_from_target_env(self) -> str | None:
+        from airflow import __version__ as airflow_version
+
         try:
             result = subprocess.check_output(
-                [self.python, "-c", "from airflow import version; 
print(version.version)"], text=True
+                [self.python, "-c", "from airflow import __version__; 
print(__version__)"], text=True

Review Comment:
   This worked in 2.0.0
   
   ```
   $ docker run --rm -ti --entrypoint python apache/airflow:2.0.0 -c "from 
airflow import __version__; print(__version__)"
   2.0.0
   ```
   
   I didn't test any older, but I think this is fine.



-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to