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


##########
airflow/providers/amazon/aws/operators/ecs.py:
##########
@@ -496,15 +496,12 @@ def __init__(
         self.tags = tags
         self.awslogs_group = awslogs_group
         self.awslogs_stream_prefix = awslogs_stream_prefix
-        self.awslogs_region = awslogs_region
+        self.awslogs_region = awslogs_region or self.region
         self.awslogs_fetch_interval = awslogs_fetch_interval
         self.propagate_tags = propagate_tags
         self.reattach = reattach
         self.number_logs_exception = number_logs_exception
 
-        if self.awslogs_region is None:
-            self.awslogs_region = self.region

Review Comment:
   Empty region_name is invalid region
   
   ```
   import boto3
   
   session = boto3.session.Session(region_name="")
   session.client("sts").get_caller_id()
   
   # ValueError: Invalid endpoint: https://sts..amazonaws.com
   ```



##########
airflow/providers/amazon/aws/operators/ecs.py:
##########
@@ -496,15 +496,12 @@ def __init__(
         self.tags = tags
         self.awslogs_group = awslogs_group
         self.awslogs_stream_prefix = awslogs_stream_prefix
-        self.awslogs_region = awslogs_region
+        self.awslogs_region = awslogs_region or self.region
         self.awslogs_fetch_interval = awslogs_fetch_interval
         self.propagate_tags = propagate_tags
         self.reattach = reattach
         self.number_logs_exception = number_logs_exception
 
-        if self.awslogs_region is None:
-            self.awslogs_region = self.region

Review Comment:
   Empty region_name is invalid region
   
   ```python
   import boto3
   
   session = boto3.session.Session(region_name="")
   session.client("sts").get_caller_id()
   
   # ValueError: Invalid endpoint: https://sts..amazonaws.com
   ```



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