From a0a0a87fd1d1e7ab9b2cfe6b5e9f12c0e9057260 Mon Sep 17 00:00:00 2001 From: capjamesg Date: Sat, 24 Aug 2024 16:31:14 +0100 Subject: [PATCH] add DATE index type --- jamesql/index.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/jamesql/index.py b/jamesql/index.py index 2f3a516..d16f538 100644 --- a/jamesql/index.py +++ b/jamesql/index.py @@ -768,9 +768,13 @@ def _run(self, query: dict, query_field: str) -> List[str]: QUERY_TYPE_COMPARISON_METHODS[query_type](query_term, gsi) ) elif query_type in QUERY_TYPE_COMPARISON_METHODS and gsi_type == GSI_INDEX_STRATEGIES.DATE: - matching_documents.extend( - *QUERY_TYPE_COMPARISON_METHODS[query_type](query_term, gsi) - ) + result = QUERY_TYPE_COMPARISON_METHODS[query_type](query_term, gsi) + if isinstance(result[0], list): + for item in result: + matching_documents.extend(item) + else: + matching_documents.extend(result) + else: for key, value in gsi.items(): if query_term is None or key is None: