I'm trying to call a function with the @task annotation N times but I cannot define the task_id using this decorator, if I try to call it more than once it says:
airflow.exceptions.DuplicateTaskIdFound: Task id 'my_task_group.make_request__1' has already been added to the DAG
@task
def make_request(params):
return true
def my_first_function():
# do stuff
return make_request(params)
def my_second_function():
# do stuff
return make_request(params)
for i in range(0, 10)
first = my_first_function() # this will call "make_request"
second = my_second_function() # this will also call "make_request"
first >> second
How can I "rename" the task_id dinamically on a @task annotation?
