SameerMesiah97 commented on code in PR #66544: URL: https://github.com/apache/airflow/pull/66544#discussion_r3202824344
########## providers/amazon/docs/operators/s3_tables.rst: ########## @@ -107,3 +107,11 @@ Reference --------- * `AWS boto3 Library Documentation for S3 Tables <https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3tables.html>`__ + +.. _howto/operator:S3TablesRenameTableOperator: + +Rename a Table +-------------- + +To rename a table in an Amazon S3 Tables namespace, use +:class:`~airflow.providers.amazon.aws.operators.s3_tables.S3TablesRenameTableOperator`. Review Comment: It seems like you are missing this part over here: ``` .. exampleinclude:: /../../amazon/tests/system/amazon/aws/example_s3_tables.py :language: python :dedent: 4 :start-after: [START howto_operator_s3tables_rename_table] :end-before: [END howto_operator_s3tables_rename_table] ``` And I believe this new section for renaming tables should be just above 'Reference'. Not after. ########## providers/amazon/tests/unit/amazon/aws/operators/test_s3_tables.py: ########## @@ -313,3 +314,31 @@ def test_execute(self, mock_conn): def test_template_fields(self): validate_template_fields(self.operator) + + +class TestS3TablesRenameTableOperator: + def setup_method(self): + self.operator = S3TablesRenameTableOperator( + task_id="rename_table", + table_bucket_arn=TABLE_BUCKET_ARN, + namespace=NAMESPACE, + table_name=TABLE_NAME, + new_name="new_table", + ) + + @mock.patch.object(S3TablesHook, "conn", new_callable=mock.PropertyMock) + def test_execute(self, mock_conn): + mock_client = mock.MagicMock() + mock_conn.return_value = mock_client + + self.operator.execute({}) + + mock_client.rename_table.assert_called_once_with( + tableBucketARN=TABLE_BUCKET_ARN, + namespace=NAMESPACE, + name=TABLE_NAME, + newName="new_table", Review Comment: Maybe you could add the optional args `new_namespace_name` and `version_token` here? -- 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]
