bug fix: missing table
This commit is contained in:
parent
0977ad1b18
commit
4b34c746ae
|
@ -1,6 +1,6 @@
|
||||||
__app_name__ = 'data-transport'
|
__app_name__ = 'data-transport'
|
||||||
__author__ = 'The Phi Technology'
|
__author__ = 'The Phi Technology'
|
||||||
__version__= '2.2.10'
|
__version__= '2.2.12'
|
||||||
__email__ = "info@the-phi.com"
|
__email__ = "info@the-phi.com"
|
||||||
__edition__= 'community'
|
__edition__= 'community'
|
||||||
__license__=f"""
|
__license__=f"""
|
||||||
|
|
|
@ -56,11 +56,17 @@ class Base:
|
||||||
# _map = {'BIGINT':'INTEGER','TEXT':'STRING','DOUBLE_PRECISION':'FLOAT','NUMERIC':'FLOAT','DECIMAL':'FLOAT','REAL':'FLOAT'}
|
# _map = {'BIGINT':'INTEGER','TEXT':'STRING','DOUBLE_PRECISION':'FLOAT','NUMERIC':'FLOAT','DECIMAL':'FLOAT','REAL':'FLOAT'}
|
||||||
# _schema = [{"name":_attr.name,"type":_map.get(str(_attr.type),str(_attr.type))} for _attr in _handler.tables[_table].columns]
|
# _schema = [{"name":_attr.name,"type":_map.get(str(_attr.type),str(_attr.type))} for _attr in _handler.tables[_table].columns]
|
||||||
#
|
#
|
||||||
|
try:
|
||||||
|
if _table :
|
||||||
|
_inspector = inspect(self._engine)
|
||||||
|
_columns = _inspector.get_columns(_table)
|
||||||
|
_schema = [{'name':column['name'],'type':_map.get(str(column['type']),str(column['type'])) } for column in _columns]
|
||||||
|
return _schema
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
|
|
||||||
_inspector = inspect(self._engine)
|
# else:
|
||||||
_columns = _inspector.get_columns(_table)
|
return []
|
||||||
_schema = [{'name':column['name'],'type':_map.get(str(column['type']),str(column['type'])) } for column in _columns]
|
|
||||||
return _schema
|
|
||||||
def has(self,**_args):
|
def has(self,**_args):
|
||||||
return self.meta(**_args)
|
return self.meta(**_args)
|
||||||
def apply(self,sql):
|
def apply(self,sql):
|
||||||
|
@ -137,8 +143,9 @@ class BaseWriter (SQLBase):
|
||||||
super().__init__(**_args)
|
super().__init__(**_args)
|
||||||
|
|
||||||
def write(self,_data,**_args):
|
def write(self,_data,**_args):
|
||||||
|
|
||||||
if type(_data) == dict :
|
if type(_data) == dict :
|
||||||
_df = pd.DataFrame(_data)
|
_df = pd.DataFrame([_data])
|
||||||
elif type(_data) == list :
|
elif type(_data) == list :
|
||||||
_df = pd.DataFrame(_data)
|
_df = pd.DataFrame(_data)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue