I have a DB that has about 90 000 products and I need to update this DB with the response from an API to each product. The problem is, this API is single call (I need to send one product SKU [request] at time), so basically, I need to call this API 90000 times.
I know that airflow has HTTP packages:
from airflow.providers.http.operators.http import SimpleHttpOperator
from airflow.providers.http.sensors.http import HttpSensor
And I can crate a task using them like:
task_get_op = SimpleHttpOperator(
task_id='get_op',
method='GET',
endpoint='get',
data={"param1": "value1", "param2": "value2"},
headers={},
dag=dag,
)
- Considering that a DAG is acyclic, how can I call this task multiple times with different params? (90 000 times with different skus more precisely...)