bbovenzi commented on code in PR #26942:
URL: https://github.com/apache/airflow/pull/26942#discussion_r992596648
##########
airflow/www/views.py:
##########
@@ -3574,13 +3586,27 @@ def datasets_summary(self):
DatasetModel.id,
DatasetModel.uri,
)
- .filter(DatasetModel.uri.ilike(f"%{uri_pattern}%"))
.order_by(*order_by)
- .offset(offset)
- .limit(limit)
- .all()
- ]
- data = {"datasets": datasets, "total_entries": total_entries}
+ )
+
+ if updated_before or updated_after:
+ count_query = count_query.outerjoin(DatasetEvent,
DatasetEvent.dataset_id == DatasetModel.id)
+ filters = []
+ if uri_pattern:
+ filters.append(DatasetModel.uri.ilike(f"%{uri_pattern}%"))
+ if updated_after:
+ filters.append(DatasetEvent.timestamp >= updated_after)
+ if updated_before:
+ filters.append(DatasetEvent.timestamp <= updated_before)
+
+ for filter in filters:
+ query = query.filter(filter)
+ count_query = count_query.filter(filter)
Review Comment:
Doh, of course.
--
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]