kazanzhy commented on code in PR #26003:
URL: https://github.com/apache/airflow/pull/26003#discussion_r963138280


##########
airflow/providers/amazon/aws/sensors/rds.py:
##########
@@ -61,7 +66,14 @@ def _check_item(self, item_type: str, item_name: str) -> 
bool:
         except ClientError:
             return False
         else:
-            return bool(items) and any(map(lambda s: 
items[0]['Status'].lower() == s, self.target_statuses))
+            status_field = self._check_status_field()
+            return bool(items) and any(
+                map(lambda status: items[0][status_field].lower() == status, 
self.target_statuses)
+            )

Review Comment:
   Also, the `return` could be modified from `map` to the generator if you 
wish. 
   ```suggestion
               return bool(items) and any(items[0][status_field].lower() == 
status for status in self.target_statuses)
   ```
   
   For me, both variants are well readable but maybe this one is better. WDYT?



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