vincbeck commented on code in PR #54195:
URL: https://github.com/apache/airflow/pull/54195#discussion_r2260292072
##########
providers/amazon/src/airflow/providers/amazon/aws/transfers/sql_to_s3.py:
##########
@@ -128,14 +134,45 @@ def __init__(
self.aws_conn_id = aws_conn_id
self.verify = verify
self.replace = replace
- self.pd_kwargs = pd_kwargs or {}
self.parameters = parameters
- self.read_pd_kwargs = read_pd_kwargs or {}
self.max_rows_per_file = max_rows_per_file
self.groupby_kwargs = groupby_kwargs or {}
self.sql_hook_params = sql_hook_params
+ self.df_type = df_type
+ if read_pd_kwargs is not None and read_kwargs is not None:
+ raise AirflowException(
+ "Cannot specify both 'read_kwargs' and 'read_pd_kwargs'. Use
'read_kwargs' instead."
+ )
+ if read_pd_kwargs is not None:
+ import warnings
+
+ warnings.warn(
+ "The 'read_pd_kwargs' parameter is deprecated. Use
'read_kwargs' instead.",
+ AirflowProviderDeprecationWarning,
+ stacklevel=2,
+ )
+ self.read_kwargs = read_pd_kwargs or {}
+ else:
+ self.read_kwargs = read_kwargs or {}
+
+ # Handle df_kwargs and pd_kwargs backward compatibility
+ if pd_kwargs is not None and df_kwargs is not None:
+ raise AirflowException(
Review Comment:
Same here
##########
providers/amazon/src/airflow/providers/amazon/aws/transfers/sql_to_s3.py:
##########
@@ -128,14 +134,45 @@ def __init__(
self.aws_conn_id = aws_conn_id
self.verify = verify
self.replace = replace
- self.pd_kwargs = pd_kwargs or {}
self.parameters = parameters
- self.read_pd_kwargs = read_pd_kwargs or {}
self.max_rows_per_file = max_rows_per_file
self.groupby_kwargs = groupby_kwargs or {}
self.sql_hook_params = sql_hook_params
+ self.df_type = df_type
+ if read_pd_kwargs is not None and read_kwargs is not None:
+ raise AirflowException(
+ "Cannot specify both 'read_kwargs' and 'read_pd_kwargs'. Use
'read_kwargs' instead."
+ )
Review Comment:
I would not raise an error but use `read_kwargs` instead. And the next if
ensures we are raised a deprecation warning so that the user is aware
--
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]