uranusjr commented on code in PR #34222:
URL: https://github.com/apache/airflow/pull/34222#discussion_r1322283558


##########
airflow/providers/amazon/aws/triggers/rds.py:
##########
@@ -129,16 +130,21 @@ def __init__(
         waiter_max_attempts: int,
         aws_conn_id: str,
         response: dict[str, Any],
-        db_type: RdsDbType,
+        db_type: RdsDbType | str,
         region_name: str | None = None,
     ) -> None:
+        # allow passing enums for users,
+        # but we can only rely on strings because (de-)serialization doesn't 
support enums
+        if isinstance(db_type, RdsDbType):
+            db_type = db_type.value

Review Comment:
   Mypy is likely complaining this particular variable is a union type instead. 
Do this:
   
   ```python
   if isinstance(db_type, RdsDbType):
       db_type_val = db_type.value
   else:
       db_type_val = db_type
   ```
   
   and change all `db_type` occurences to `db_type_val` and Mypy should be 
satisfied.



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