Skip to content

Instantly share code, notes, and snippets.

@arnaud9
Last active May 30, 2021 01:53
Show Gist options
  • Save arnaud9/841da3038b75a15d747351acad5471cf to your computer and use it in GitHub Desktop.
Save arnaud9/841da3038b75a15d747351acad5471cf to your computer and use it in GitHub Desktop.
import airflow.hooks.S3_hook
def upload_file_to_S3_with_hook(filename, key, bucket_name):
hook = airflow.hooks.S3_hook.S3Hook('my_S3_conn')
hook.load_file(filename, key, bucket_name)
@JoanAlexanderRodriguez
Copy link

JoanAlexanderRodriguez commented Feb 26, 2020

Hi,

Do I have to place that code in the dag file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment