GitHub user assadali007 edited a discussion: Airflow BashOperator adds %27 to curl URL when templating dates
<img width="1157" height="344" alt="Screen Shot 2026-01-03 at 6 35 30 PM" src="https://github.com/user-attachments/assets/a50a24a2-57f9-40a0-a90c-827e5f597e92" /> <img width="1157" height="256" alt="Screen Shot 2026-01-03 at 6 30 50 PM" src="https://github.com/user-attachments/assets/9d660d41-0e4d-4386-ab21-dec5d4035750" /> I’m learning BashOperator to fetch data per day from the local API using data_interval_start and data_interval_end. When the task runs, the rendered curl command contains an extra %27 (URL-encoded single quote) at the end of the URL, which breaks the request. on picture you could not when i click on the link on log %27 come to end it breaks the request `fetch_events = BashOperator( task_id="fetch_events", bash_command=( "mkdir -p /data/events && " "curl -o /data/events.json " "http://events_api:5000/events?" "start_date={{data_interval_start.strftime('%Y-%m-%d')}}&" "end_date={{data_interval_end.strftime('%Y-%m-%d')}}" ), dag=dag, ) ` GitHub link: https://github.com/apache/airflow/discussions/60078 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected]
