potiuk commented on code in PR #52422:
URL: https://github.com/apache/airflow/pull/52422#discussion_r2173818718


##########
providers/yandex/tests/unit/yandex/operators/test_yq.py:
##########
@@ -54,7 +52,8 @@ def setup_method(self):
     def test_execute_query(self, mock_get_connection):
         mock_get_connection.return_value = Connection(extra={"oauth": 
OAUTH_TOKEN})
         operator = YQExecuteQueryOperator(task_id="simple_sql", sql="select 
987", folder_id="my_folder_id")
-        context = {"ti": MagicMock()}
+        mock_ti = MagicMock()
+        context = {"ti": mock_ti, "task_instance": mock_ti}

Review Comment:
   Suggestion. I think it's better to add "task_instance" separately only when 
not V_3_0. This is how I wanted to fix it initially but I realized that that 
could hide some problems - because we "expect" in Airflow 3 that 
"task_instance" is not present in context at all. So adding both always might 
cause false positives for Airflow 3 if someone attempts to access 
"task_instance".



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