hi everyone, in my use case there are hundreds of ...
# prefect-getting-started
n
hi everyone, in my use case there are hundreds of flows that do the same task (let's say "upload_to_s3"). Is there an easy/suggested way to create a single task that can be used in these flows that allows to change task parameters (name, retries ecc...)? I managed to do so in this way: functions.py file
Copy code
def 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
Copy code
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)
k
n
thanks a lot