josh-fell commented on a change in pull request #18447: URL: https://github.com/apache/airflow/pull/18447#discussion_r714833401
########## File path: airflow/providers/amazon/aws/example_dags/example_redshift.py ########## @@ -0,0 +1,70 @@ +# +# 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. +""" +This is an example dag for using `RedshiftOperator` to authenticate with Amazon Redshift +using IAM authentication then executing a simple select statement +""" +# [START redshift_operator_howto_guide] +from airflow import DAG +from airflow.providers.amazon.aws.operators.redshift import RedshiftOperator +from airflow.utils.dates import days_ago + +with DAG(dag_id="example_redshift", start_date=days_ago(1), schedule_interval=None, tags=['example']) as dag: + # [START howto_operator_s3_to_redshift_create_table] + setup__task_create_table = RedshiftOperator( + redshift_conn_id='redshift_default', Review comment: You don't necessarily need to pass in the `redshift_conn_id` parameter to each `RedshiftOperator` task since the default value is being used here. Or, if you would like to specify a non-default value for `redshift_conn_id`, you could add it into the DAG `default_args` since this arg is passed to every operator in the DAG. -- 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]
