Why does Airflow BashOperator fetch multiple days of data when API URL has single-day date range? #60051
-
|
I am learning Apache Airflow and created a simple DAG to fetch daily events from a REST API.When I call the API directly in the browser, it correctly returns one day of data http://localhost:5000/events?start_date=2019-01-01&end_date=2019-01-02 However, when I call the same API URL using an Airflow BashOperator, the output file contains data from 2019-01-01 to 2019-01-05, which is unexpected. fetch_events = BashOperator( fetch_events |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Single |
Beta Was this translation helpful? Give feedback.
-
|
it solve it |
Beta Was this translation helpful? Give feedback.


it solve it
fetch_events = BashOperator( task_id="fetch_events", bash_command=( "mkdir -p /Users/asadali/data/events && " "curl -o /Users/asadali/data/events/events.json " "\"http://localhost:5000/events?start_date=2019-01-01&end_date=2019-01-02\"" ), dag=dag )