kazanzhy commented on code in PR #26003:
URL: https://github.com/apache/airflow/pull/26003#discussion_r963135500
##########
airflow/providers/amazon/aws/sensors/rds.py:
##########
@@ -38,10 +38,10 @@ def __init__(self, *args, aws_conn_id: str = "aws_conn_id",
hook_params: Optiona
hook_params = hook_params or {}
self.hook = RdsHook(aws_conn_id=aws_conn_id, **hook_params)
self.target_statuses: List[str] = []
+ self.check_status_field = "Status"
Review Comment:
I think it is OK to add one more `if-else`.
Actually, I meant something like:
```
def _check_item(self, item_type: str, item_name: str) -> bool:
"""Get certain item from `_describe_item()` and check its status"""
if item_type == 'db_instance':
status_field = 'DBInstanceStatus'
else:
status_field = 'Status'
try:
items = self._describe_item(item_type, item_name)
except ClientError:
return False
else:
return bool(items) and any(
map(lambda status: items[0][status_field].lower() == status,
self.target_statuses)
)
```
Seems only `DBInstance` has this issue with the Status field.
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]