This is an automated email from the ASF dual-hosted git repository.
ferruzzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 5623a21a1f deprecate arbitrary parameter passing to RDS hook (#32352)
5623a21a1f is described below
commit 5623a21a1fc738ccb97ade4d4197b181bf1128d4
Author: Raphaƫl Vandon <[email protected]>
AuthorDate: Tue Jul 4 13:28:15 2023 -0700
deprecate arbitrary parameter passing to RDS hook (#32352)
* deprecate arbitrary parameter passing to RDS hook
* add url to PR
---
airflow/providers/amazon/aws/operators/rds.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/airflow/providers/amazon/aws/operators/rds.py
b/airflow/providers/amazon/aws/operators/rds.py
index 440d895afa..9aef670166 100644
--- a/airflow/providers/amazon/aws/operators/rds.py
+++ b/airflow/providers/amazon/aws/operators/rds.py
@@ -18,12 +18,13 @@
from __future__ import annotations
import json
+import warnings
from datetime import timedelta
from typing import TYPE_CHECKING, Sequence
from mypy_boto3_rds.type_defs import TagTypeDef
-from airflow.exceptions import AirflowException
+from airflow.exceptions import AirflowException,
AirflowProviderDeprecationWarning
from airflow.models import BaseOperator
from airflow.providers.amazon.aws.hooks.rds import RdsHook
from airflow.providers.amazon.aws.triggers.rds import RdsDbInstanceTrigger
@@ -42,6 +43,15 @@ class RdsBaseOperator(BaseOperator):
ui_fgcolor = "#ffffff"
def __init__(self, *args, aws_conn_id: str = "aws_conn_id", hook_params:
dict | None = None, **kwargs):
+ if hook_params is not None:
+ warnings.warn(
+ "The parameter hook_params is deprecated and will be removed. "
+ "If you were using it, please get in touch either on airflow
slack, "
+ "or by opening a github issue on the project. "
+ "You can mention https://github.com/apache/airflow/pull/32352",
+ AirflowProviderDeprecationWarning,
+ stacklevel=3, # 2 is in the operator's init, 3 is in the user
code creating the operator
+ )
self.hook_params = hook_params or {}
self.hook = RdsHook(aws_conn_id=aws_conn_id, **self.hook_params)
super().__init__(*args, **kwargs)