ephraimbuddy commented on a change in pull request #9153:
URL: https://github.com/apache/airflow/pull/9153#discussion_r436362002
##########
File path: airflow/api_connexion/endpoints/dag_run_endpoint.py
##########
@@ -73,36 +71,36 @@ def get_dag_runs(dag_id, session):
# filter start date
if start_date_gte and start_date_lte:
- query = query.filter(DagRun.start_date <= start_date_lte,
- DagRun.start_date >= start_date_gte)
+ query = query.filter(DagRun.start_date <=
timezone.parse(start_date_lte),
+ DagRun.start_date >=
timezone.parse(start_date_gte))
elif start_date_gte and not start_date_lte:
- query = query.filter(DagRun.start_date >= start_date_gte)
+ query = query.filter(DagRun.start_date >=
timezone.parse(start_date_gte))
elif start_date_lte and not start_date_gte:
- query = query.filter(DagRun.start_date <= start_date_lte)
+ query = query.filter(DagRun.start_date <=
timezone.parse(start_date_lte))
Review comment:
After reading this stackoverflow answer, it looks like it is correct
this way but I don't know why my test fail when I set start_date_lte to be
equal to DagRun.start_date. I will call your attention for review, once I'm done
https://stackoverflow.com/questions/51451768/sqlalchemy-querying-with-datetime-columns-to-filter-by-month-day-year/51468737#51468737
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]