Taragolis commented on code in PR #38178:
URL: https://github.com/apache/airflow/pull/38178#discussion_r1526230744


##########
tests/providers/amazon/aws/operators/test_ecs.py:
##########
@@ -680,6 +681,23 @@ def test_execute_complete(self, client_mock):
         # task gets described to assert its success
         client_mock().describe_tasks.assert_called_once_with(cluster="c", 
tasks=["my_arn"])
 
+    @pytest.mark.db_test
+    def test_partial_deprecated_region(self, dag_maker):
+        with dag_maker("test_partial_deprecated_region_esc_run_task"):
+            EcsRunTaskOperator.partial(
+                task_id="fake-task-id",
+                region="ca-west-1",
+                cluster="foo",
+                task_definition="bar",
+            ).expand(overrides=[{}, {}, {}])
+
+        dr = dag_maker.create_dagrun(execution_date=timezone.utcnow())
+        warning_match = r"`region` is deprecated and will be removed"
+        for ti in dr.task_instances:
+            with pytest.warns(AirflowProviderDeprecationWarning, 
match=warning_match):
+                ti.render_templates()

Review Comment:
   Nope, I've revert that PR locally and still got an error if render templates
   
   ```console
   ❯ pytest 
tests/providers/amazon/aws/operators/test_ecs.py::TestEcsRunTaskOperator 
tests/providers/amazon/aws/operators/test_base_aws.py 
tests/providers/amazon/aws/sensors/test_base_aws.py
   
   ...
   
   
======================================================================================================
 short test summary info 
======================================================================================================
   FAILED 
tests/providers/amazon/aws/operators/test_base_aws.py::TestAwsBaseOperator::test_execute[all-params-provided]
 - RuntimeError: Session already set for this task. You can only have one 
'set_current_task_session' context manager active at a time.
   FAILED 
tests/providers/amazon/aws/operators/test_base_aws.py::TestAwsBaseOperator::test_execute[default-only]
 - RuntimeError: Session already set for this task. You can only have one 
'set_current_task_session' context manager active at a time.
   FAILED 
tests/providers/amazon/aws/operators/test_base_aws.py::TestAwsBaseOperator::test_region_in_partial_operator[region-only]
 - RuntimeError: Session already set for this task. You can only have one 
'set_current_task_session' context manager active at a time.
   FAILED 
tests/providers/amazon/aws/operators/test_base_aws.py::TestAwsBaseOperator::test_region_in_partial_operator[non-ambiguous-params]
 - RuntimeError: Session already set for this task. You can only have one 
'set_current_task_session' context manager active at a time.
   FAILED 
tests/providers/amazon/aws/operators/test_base_aws.py::TestAwsBaseOperator::test_ambiguous_region_in_partial_operator
 - RuntimeError: Session already set for this task. You can only have one 
'set_current_task_session' context manager active at a time.
   FAILED 
tests/providers/amazon/aws/sensors/test_base_aws.py::TestAwsBaseSensor::test_execute[all-params-provided]
 - RuntimeError: Session already set for this task. You can only have one 
'set_current_task_session' context manager active at a time.
   FAILED 
tests/providers/amazon/aws/sensors/test_base_aws.py::TestAwsBaseSensor::test_execute[default-only]
 - RuntimeError: Session already set for this task. You can only have one 
'set_current_task_session' context manager active at a time.
   FAILED 
tests/providers/amazon/aws/sensors/test_base_aws.py::TestAwsBaseSensor::test_region_in_partial_sensor[region-only]
 - RuntimeError: Session already set for this task. You can only have one 
'set_current_task_session' context manager active at a time.
   FAILED 
tests/providers/amazon/aws/sensors/test_base_aws.py::TestAwsBaseSensor::test_region_in_partial_sensor[non-ambiguous-params]
 - RuntimeError: Session already set for this task. You can only have one 
'set_current_task_session' context manager active at a time.
   FAILED 
tests/providers/amazon/aws/sensors/test_base_aws.py::TestAwsBaseSensor::test_ambiguous_region_in_partial_sensor
 - RuntimeError: Session already set for this task. You can only have one 
'set_current_task_session' context manager active at a time.
   
============================================================================================
 10 failed, 57 passed, 45 warnings in 3.48s 
=============================================================================================
   ❯ pytest 
tests/providers/amazon/aws/operators/test_ecs.py::TestEcsRunTaskOperator 
tests/providers/amazon/aws/operators/test_base_aws.py 
tests/providers/amazon/aws/sensors/test_base_aws.py
   
   ```



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