From 2db128fb36113e7cdd5242a384db37385bc02afb Mon Sep 17 00:00:00 2001 From: Daniel Naber Date: Wed, 3 Jul 2024 00:39:35 +0200 Subject: [PATCH] Notion date filter fix (#1755) * fix filter logic * make comparison better readable --- backend/danswer/connectors/notion/connector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/danswer/connectors/notion/connector.py b/backend/danswer/connectors/notion/connector.py index cadf10b328f..fd607e4f97a 100644 --- a/backend/danswer/connectors/notion/connector.py +++ b/backend/danswer/connectors/notion/connector.py @@ -368,7 +368,7 @@ def _filter_pages_by_time( compare_time = time.mktime( time.strptime(page[filter_field], "%Y-%m-%dT%H:%M:%S.000Z") ) - if compare_time <= end or compare_time > start: + if compare_time > start and compare_time <= end: filtered_pages += [NotionPage(**page)] return filtered_pages