diff --git a/src/pyodb/schema/base/_operators.py b/src/pyodb/schema/base/_operators.py index 392a5d7..f477b69 100644 --- a/src/pyodb/schema/base/_operators.py +++ b/src/pyodb/schema/base/_operators.py @@ -211,6 +211,9 @@ def _break_down_type(cls, type_: type | UnionType | GenericAlias) -> type | Unio if hasattr(type_, "__origin__"): type_ = type_.__origin__ + if type_ is Any: + raise MixedTypesError("Type of class member cannot be 'Any'!") + return type_ diff --git a/src/pyodb/schema/base/_sql_builders.py b/src/pyodb/schema/base/_sql_builders.py index d3a5bca..41791b6 100644 --- a/src/pyodb/schema/base/_sql_builders.py +++ b/src/pyodb/schema/base/_sql_builders.py @@ -125,6 +125,7 @@ def commit(self, dbconn: sql.Connection) -> None: insert = insert[:-1] + ");" with dbconn as conn: conn.executemany(insert, self._vals) + conn.commit() @property diff --git a/test/pyodb/schema/base/sql_builders_test.py b/test/pyodb/schema/base/sql_builders_test.py index bea6fdc..8475e6a 100644 --- a/test/pyodb/schema/base/sql_builders_test.py +++ b/test/pyodb/schema/base/sql_builders_test.py @@ -1,7 +1,7 @@ from pathlib import Path from test.test_models.complex_models import ComplexMulti from test.test_models.primitive_models import PrimitiveBasic, PrimitiveContainer -from time import time +from time import sleep, time from unittest import TestCase from pyodb.error import BadTypeError, ExpiryError, ParentError, QueryError