Niccolò Randazzini
12/01/2023, 10:24 AMdef upload_to_S3(local_file_path: pathlib.Path, s3_block_name: str, s3_path: str) -> None:
s3_block = Block.load(s3_block_name)
s3_block.upload_from_path(from_path=local_file_path, to_path=s3_path)
def get_task(func, name:str = None, task_params: dict = None):
return Task(func, name, **task_params)
and then in the flow files
task_params = dict(retries=10, retry_delay_seconds=300)
task = get_task(upload_to_S3, name="upload_to_S3_customer", task_params=task_params)
task(local_file_path=pathlib.Path(local_file_path), s3_block_name=s3_block_name,s3_path=s3_path)
Kevin Grismore
12/01/2023, 10:34 AMNiccolò Randazzini
12/01/2023, 11:08 AM