Adaverse commented on code in PR #32328:
URL: https://github.com/apache/airflow/pull/32328#discussion_r1251222624
##########
tests/providers/amazon/aws/transfers/test_s3_to_redshift.py:
##########
@@ -443,8 +492,21 @@ def test_using_redshift_data_api(self, mock_rs, mock_run,
mock_session, mock_con
StatementName=statement_name,
WithEvent=False,
)
+
+ expected_copy_query = """
+ COPY schema.table
+ FROM 's3://bucket/key'
+ credentials
+
'aws_access_key_id=aws_access_key_id;aws_secret_access_key=aws_secret_access_key'
+ ;
+ """
+ actual_copy_query = mock_rs.execute_statement.call_args.kwargs["Sql"]
+
mock_rs.describe_statement.assert_called_once_with(
Id="STATEMENT_ID",
)
+
+ assert access_key in actual_copy_query
+ assert secret_key in actual_copy_query
# test sql arg
Review Comment:
this comment seems to be redundant since the next statement is clear on what
it's doing.
##########
tests/providers/amazon/aws/transfers/test_s3_to_redshift.py:
##########
@@ -420,16 +477,8 @@ def test_using_redshift_data_api(self, mock_rs, mock_run,
mock_session, mock_con
),
)
op.execute(None)
- copy_query = """
- COPY schema.table
- FROM 's3://bucket/key'
- credentials
-
'aws_access_key_id=aws_access_key_id;aws_secret_access_key=aws_secret_access_key'
- ;
- """
+
mock_run.assert_not_called()
- assert access_key in copy_query
- assert secret_key in copy_query
mock_rs.execute_statement.assert_called_once()
# test with all args besides sql
Review Comment:
Same about this comment as well. Only for non-obvious or cheeky things can
we keep comments.
--
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]