From 329a575f8969ffdb2cd032872ee9d8db16a345a3 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Tue, 28 Jan 2025 14:19:20 -0600 Subject: [PATCH] bug fix: issue with sqlalchemy & python 3.12 --- transport/sql/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transport/sql/common.py b/transport/sql/common.py index e10a374..e3feb5c 100644 --- a/transport/sql/common.py +++ b/transport/sql/common.py @@ -34,7 +34,7 @@ class Base: :table optional name of the table (can be fully qualified) """ _table = self._table if 'table' not in _args else _args['table'] - _map = {'BIGINT':'INTEGER','TEXT':'STRING','DOUBLE_PRECISION':'FLOAT','NUMERIC':'FLOAT','DECIMAL':'FLOAT','REAL':'FLOAT'} + _map = {'TINYINT':'INTEGER','BIGINT':'INTEGER','TEXT':'STRING','DOUBLE_PRECISION':'FLOAT','NUMERIC':'FLOAT','DECIMAL':'FLOAT','REAL':'FLOAT'} _schema = [] # if _table : # if sqa.__version__.startswith('1.') : @@ -53,7 +53,7 @@ class Base: _inspector = inspect(self._engine) _columns = _inspector.get_columns(_table) - _schema = [{'name':column['name'],'type':str(column['type']) } for column in _columns] + _schema = [{'name':column['name'],'type':_map.get(str(column['type']),str(column['type'])) } for column in _columns] return _schema def has(self,**_args): return self.meta(**_args)