This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 24426f38b9 Do not attempt to refresh task instance in session for DB 
isolation (#41117)
24426f38b9 is described below

commit 24426f38b95f957db522a94f79907c3310a2d09f
Author: Jarek Potiuk <[email protected]>
AuthorDate: Tue Jul 30 19:50:43 2024 +0200

    Do not attempt to refresh task instance in session for DB isolation (#41117)
    
    When Database Isolation mode is on refreshing task should not
    check if task instance is already in the session - because
    the session is not there.
    
    Related: #41067
---
 airflow/models/taskinstance.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/airflow/models/taskinstance.py b/airflow/models/taskinstance.py
index 5b00dba557..fb3fb46f6d 100644
--- a/airflow/models/taskinstance.py
+++ b/airflow/models/taskinstance.py
@@ -845,8 +845,9 @@ def _refresh_from_db(
 
     :meta private:
     """
-    if session and task_instance in session:
-        session.refresh(task_instance, 
TaskInstance.__mapper__.column_attrs.keys())
+    if not InternalApiConfig.get_use_internal_api():
+        if session and task_instance in session:
+            session.refresh(task_instance, 
TaskInstance.__mapper__.column_attrs.keys())
 
     ti = TaskInstance.get_task_instance(
         dag_id=task_instance.dag_id,

Reply via email to