I want to truncate my Redshift table before loading CSV file into Redshift table.
Error: airflow.exceptions.AirflowException: Invalid arguments were passed to S3ToRedshiftOperator (task_id: dag_run_s3_to_redshift). Invalid arguments were: **kwargs: {'method': 'REPLACE'}
Below Code:
task_fail_s3_to_redshift = S3ToRedshiftOperator(
s3_bucket=S3_BUCKET,
s3_key="{{ti.xcom_pull(task_ids='export_db',key='FILE_PATH_1')}}",
schema="dw_stage",
table="task_fail",
copy_options=['csv',"IGNOREHEADER 1"],
redshift_conn_id='redshift',
method='REPLACE',
task_id='task_fail_s3_to_redshift',
)
start >> task_fail_s3_to_redshift >> end