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/11 17:44:02 UTC

[GitHub] [airflow] mik-laj opened a new issue #9237: Inclusive or exclusive range fitlers in API

mik-laj opened a new issue #9237:
URL: https://github.com/apache/airflow/issues/9237


   Helllo,
   
   We have the following ranger filter parameters:
   
   - FilterDurationGTE
   - FilterDurationLTE
   - FilterEndDateGTE
   - FilterEndDateLTE
   - FilterExecutionDateGTE
   - FilterExecutionDateLTE
   - FilterStartDateGTE
   - FilterStartDateLTE
   
   Only closed ranged(in interval notation: [start_xxx, end_xxx]) can be fetched using them.
   
   I think, filters representing ranges should use inclusive start values and exclusive end values (half-closed intervals); in interval notation: [start_xxx, end_xxx).
   
   Exclusive end values are preferable for the following reasons:
   
   * It conforms to user expectations, particularly for continuous values such as timestamps, and avoids the need to express imprecise “limit values” (e.g. 2012-04-20T23:59:59).
   * It is consistent with most common programming languages, including C++, Java, Python, and Go.
   * It is easier to reason about abutting ranges: [0, x), [x, y), [y, z), where values are chainable from one range to the next.
   
   More information: https://google.aip.dev/145
   
   Alternatively, we can also add LT and GT filters, but this could only complicate situations without much benefit. We would have 4 different parameters for one field. Changing parameter names and changing behavior seems better to me.
   
   Best regards,
   Kamil Breguła


----------------------------------------------------------------
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



[GitHub] [airflow] mik-laj commented on issue #9237: Inclusive or exclusive range fitlers in API

Posted by GitBox <gi...@apache.org>.
mik-laj commented on issue #9237:
URL: https://github.com/apache/airflow/issues/9237#issuecomment-643814002


   @houqp I haven't started the discussion on the mailing list about this problem yet, but maybe you have some thought?


----------------------------------------------------------------
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



[GitHub] [airflow] potiuk commented on issue #9237: Inclusive or exclusive range filters in API

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #9237:
URL: https://github.com/apache/airflow/issues/9237#issuecomment-643821659


   Yep. Agree using GTE and LT is a better approach. I think it also encourages good patterns.
   
   However I think this is only valid in case of dates, not durations. For duration i would also like  to have <= 200 seconds not only >= 200 seconds (but it also depends on the resolution of duration).  
   
   So I'd opt for all 4 operators for duration but only GTE/LT for dates.  
   
   
   


----------------------------------------------------------------
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



[GitHub] [airflow] houqp commented on issue #9237: Inclusive or exclusive range filters in API

Posted by GitBox <gi...@apache.org>.
houqp commented on issue #9237:
URL: https://github.com/apache/airflow/issues/9237#issuecomment-643820077


   @mik-laj yes, ` [start_xxx, end_xxx)` is much easier to use than ` [start_xxx, end_xxx]` from a client's point of view. If we don't want to support all 4 comparison operators, then I would love to see us at least switch to GTE and LT. 


----------------------------------------------------------------
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