From ad4312c40c142c37278967e04870e4086591113a Mon Sep 17 00:00:00 2001 From: Nicolay Rusnachenko Date: Mon, 18 Dec 2023 11:42:14 +0000 Subject: [PATCH] #536 fixed `RowCacheStorage` related bug that caused with SQLite usage. List of column names and column types are now even in terms of their length. --- arekit/contrib/utils/data/storages/row_cache.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arekit/contrib/utils/data/storages/row_cache.py b/arekit/contrib/utils/data/storages/row_cache.py index c04e30dd..36f84498 100644 --- a/arekit/contrib/utils/data/storages/row_cache.py +++ b/arekit/contrib/utils/data/storages/row_cache.py @@ -33,7 +33,12 @@ def init_empty(self, columns_provider): # Expand with columns that are forced to be provided. existed_set = set(self.__column_names) - self.__column_names += [c for c in self.__force_collect_columns if c not in existed_set] + + # Calculate extension: columns that were not mentioned in column names list. + extension = [c for c in self.__force_collect_columns if c not in existed_set] + + self.__column_names += extension + self.__column_types += [str] * len(extension) def iter_column_names(self): return iter(self.__column_names)