You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/06 19:00:20 UTC

[GitHub] [airflow] ephraimbuddy commented on a change in pull request #9153: [WIP] add readonly endpoints for dagruns

ephraimbuddy commented on a change in pull request #9153:
URL: https://github.com/apache/airflow/pull/9153#discussion_r436292265



##########
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:
       Hi @mik-laj , please is there another way I could do this without `<=` operator. It seems not to work when times are equal.




----------------------------------------------------------------
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:
users@infra.apache.org