From 6fa18c891ae66cb0c679af4714853b86c93dd7fc Mon Sep 17 00:00:00 2001 From: Magnus Lindholm Date: Wed, 6 Sep 2023 12:31:57 +0200 Subject: [PATCH] Hotfix: removed strict = True from all zip() operations, since it caused errors in convertool --- acacore/database/base.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/acacore/database/base.py b/acacore/database/base.py index 84cf9de..9d733f5 100644 --- a/acacore/database/base.py +++ b/acacore/database/base.py @@ -47,7 +47,7 @@ def fetchalltuples(self) -> Generator[tuple, None, None]: Returns: Generator: A generator for the tuples in the cursor. """ - return (tuple(c.from_entry(v) for c, v in zip(self.columns, vs, strict=True)) for vs in self.cursor.fetchall()) + return (tuple(c.from_entry(v) for c, v in zip(self.columns, vs)) for vs in self.cursor.fetchall()) def fetchonetuple(self) -> Optional[tuple]: """ @@ -58,7 +58,7 @@ def fetchonetuple(self) -> Optional[tuple]: """ vs: tuple = self.cursor.fetchone() - return tuple(c.from_entry(v) for c, v in zip(self.columns, vs, strict=True)) if vs else None + return tuple(c.from_entry(v) for c, v in zip(self.columns, vs)) if vs else None @overload def fetchall(self) -> Generator[dict[str, Any], None, None]: @@ -83,13 +83,13 @@ def fetchall(self, model: Optional[Type[M]] = None) -> Generator[Union[dict[str, if model: return ( model.model_validate( - {c.alias or c.name: v for c, v in zip(select_columns, vs, strict=True)}, + {c.alias or c.name: v for c, v in zip(select_columns, vs)}, ) for vs in self.cursor.fetchall() ) return ( - {c.alias or c.name: c.from_entry(v) for c, v in zip(select_columns, vs, strict=True)} + {c.alias or c.name: c.from_entry(v) for c, v in zip(select_columns, vs)} for vs in self.cursor.fetchall() ) @@ -120,7 +120,7 @@ def fetchone( if vs is None: return None - entry: dict[str, Any] = {c.name: c.from_entry(v) for c, v in zip(select_columns, vs, strict=True)} + entry: dict[str, Any] = {c.name: c.from_entry(v) for c, v in zip(select_columns, vs)} return model.model_validate(entry) if model else entry