amoghrajesh commented on code in PR #58148:
URL: https://github.com/apache/airflow/pull/58148#discussion_r2519460716


##########
providers/standard/src/airflow/providers/standard/utils/python_virtualenv_script.jinja2:
##########
@@ -40,6 +40,16 @@ if sys.version_info >= (3,6):
         pass
 {% endif %}
 
+try:
+    from airflow.sdk.execution_time import task_runner
+except ModuleNotFoundError:
+    pass
+else:
+  {#- We are in an Airflow 3.x env, try and set up supervisor comms so virtual 
env can still access tasks etc! #}
+  reinit_supervisor_comms = getattr(task_runner, "reinit_supervisor_comms", 
None)
+  if reinit_supervisor_comms:
+      reinit_supervisor_comms()

Review Comment:
   ```suggestion
     if reinit_supervisor_comms := getattr(task_runner, 
"reinit_supervisor_comms", None):
         reinit_supervisor_comms()
   ```



##########
providers/standard/src/airflow/providers/standard/utils/python_virtualenv_script.jinja2:
##########
@@ -40,6 +40,16 @@ if sys.version_info >= (3,6):
         pass
 {% endif %}
 
+try:
+    from airflow.sdk.execution_time import task_runner
+except ModuleNotFoundError:
+    pass
+else:
+  {#- We are in an Airflow 3.x env, try and set up supervisor comms so virtual 
env can still access tasks etc! #}

Review Comment:
   ```suggestion
     {#- We are in a Airflow 3.x environment, set up supervisor comms so 
virtualenv subprocess can access things that normal tasks can #}
   ```



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