Skip to content

Commit

Permalink
quick fix on RDS operator to prevent parameter collision (#32436)
Browse files Browse the repository at this point in the history
* quick fix on RDS operator to prevent parameter collision 

without this code, if the user specified a region in the hook params, it'd create an error about the param being specified twice

* use initialized value
  • Loading branch information
vandonr-amz committed Jul 7, 2023
1 parent 9cb463e commit 8c6751f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions airflow/providers/amazon/aws/operators/rds.py
Expand Up @@ -62,8 +62,9 @@ def __init__(
AirflowProviderDeprecationWarning,
stacklevel=3, # 2 is in the operator's init, 3 is in the user code creating the operator
)
self.region_name = region_name
self.hook = RdsHook(aws_conn_id=aws_conn_id, region_name=region_name, **(hook_params or {}))
hook_params = hook_params or {}
self.region_name = region_name or hook_params.pop("region_name", None)
self.hook = RdsHook(aws_conn_id=aws_conn_id, region_name=self.region_name, **(hook_params))
super().__init__(*args, **kwargs)

self._await_interval = 60 # seconds
Expand Down

0 comments on commit 8c6751f

Please sign in to comment.