utkarsharma2 commented on code in PR #38465:
URL: https://github.com/apache/airflow/pull/38465#discussion_r1607951700
##########
airflow/providers/cohere/hooks/cohere.py:
##########
@@ -46,23 +59,34 @@ def __init__(
conn_id: str = default_conn_name,
timeout: int | None = None,
max_retries: int | None = None,
+ request_options: dict | None = None,
) -> None:
super().__init__()
self.conn_id = conn_id
self.timeout = timeout
self.max_retries = max_retries
+ self.request_options = request_options
+ if self.max_retries:
+ warnings.warn(
+ "Argument `max_retries` is deprecated. Please use
`request_options` dict for function-specific request configuration instead.",
+ AirflowProviderDeprecationWarning,
+ stacklevel=2,
+ )
+ self.request_options = (
+ {"max_retries": self.max_retries}
+ if self.request_options is None
+ else self.request_options.update({"max_retries":
self.max_retries})
Review Comment:
Looks like `self.request_options` will be `None` everytime in `else` case.

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