ashb commented on code in PR #66696:
URL: https://github.com/apache/airflow/pull/66696#discussion_r3217564639
##########
airflow-core/src/airflow/api_fastapi/common/parameters.py:
##########
@@ -898,6 +898,35 @@ def is_active(self) -> bool:
)
+class NullableDatetimeRangeFilter(RangeFilter):
+ """
+ RangeFilter for nullable datetime columns that preserves NULL-as-now
semantics.
+
+ Uses explicit OR conditions instead of COALESCE(column, now()) so
PostgreSQL
+ can use btree indexes on each branch via BitmapOr plans rather than forcing
+ a full table scan.
+ """
+
+ def to_orm(self, select: Select) -> Select:
+ if self.value is None:
+ return select
Review Comment:
It's probably nothing/not possible to hit over an HTTP api, but this feels
like this doesn't let us explicitly filter for this value not being set, and
`value is None` could be a ` where(self.attribute.is_(None)` thing?
Maybe ignore me, but if it's delibarate we don't allow that explicitly say
so.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]