satish-chinthanippu commented on code in PR #39217: URL: https://github.com/apache/airflow/pull/39217#discussion_r1616971021
########## airflow/providers/teradata/transfers/s3_to_teradata.py: ########## @@ -0,0 +1,109 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +from __future__ import annotations + +from textwrap import dedent +from typing import TYPE_CHECKING, Sequence + +from airflow.models import BaseOperator + +try: + from airflow.providers.amazon.aws.hooks.s3 import S3Hook +except ModuleNotFoundError as e: + from airflow.exceptions import AirflowOptionalProviderFeatureException + + raise AirflowOptionalProviderFeatureException(e) +from airflow.providers.teradata.hooks.teradata import TeradataHook + +if TYPE_CHECKING: + from airflow.utils.context import Context + + +class S3ToTeradataOperator(BaseOperator): + """ + Loads CSV, JSON and Parquet format data from Amazon S3 to Teradata. + + .. seealso:: + For more information on how to use this operator, take a look at the guide: + :ref:`howto/operator:S3ToTeradataOperator` + + :param s3_source_key: The URI format specifying the location of the S3 bucket.(templated) + The URI format is /s3/YOUR-BUCKET.s3.amazonaws.com/YOUR-BUCKET-NAME. + Refer to + https://docs.teradata.com/search/documents?query=native+object+store&sort=last_update&virtual-field=title_only&content-lang=en-US + :param public_bucket: Specifies whether the provided S3 bucket is public. If the bucket is public, + it means that anyone can access the objects within it via a URL without requiring authentication. + If the bucket is private and authentication is not provided, the operator will throw an exception. Review Comment: Teradata has Teradata-supplied public buckets or containers with test data to try out transfers from S3/AzureBlob/Google Storage to teradata. https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/Teradata-VantageTM-Native-Object-Store-Getting-Started-Guide-17.20/Setting-Up-Access/Variable-Substitutions-for-Examples. Added public_bucket parameter to specify given S3 path is public. If it is public bucket/container, the operator skips getting credentials from S3 Hook https://github.com/apache/airflow/blob/1b1e1cc4905ca993c66b0b8e024d64e9701c2835/airflow/providers/teradata/transfers/s3_to_teradata.py#L89 -- 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]
