When we execute copy into statement twice the first statement loads data in the table but fails if the self.hook.run doesn't accept the handler function as a result we execute the statement a second time but this time there is no file loaded. This PR solves the issue by ensuring the statement is executed only once to ensure the data is loading correctly. Also, this is an optimization to only execute the statement once.
When we execute copy into statement twice the first statement loads data in the table but fails if the
self.hook.run
doesn't accept the handler function as a result we execute the statement a second time but this time there is no file loaded. This PR solves the issue by ensuring the statement is executed only once to ensure the data is loading correctly. Also, this is an optimization to only execute the statement once.Issue - https://github.com/astronomer/apache-airflow-providers-transfers/actions/runs/5880997317/job/15949964951