bug fix: initialization of fields unnecessary
This commit is contained in:
parent
653d22cd8c
commit
8f94ea260b
|
@ -235,15 +235,15 @@ class SQLWriter(SQLRW,Writer):
|
||||||
self._cast = False if 'cast' not in _args else _args['cast']
|
self._cast = False if 'cast' not in _args else _args['cast']
|
||||||
|
|
||||||
def init(self,fields=None):
|
def init(self,fields=None):
|
||||||
if not fields :
|
# if not fields :
|
||||||
try:
|
# try:
|
||||||
table = self._tablename(self.table)
|
# table = self._tablename(self.table)
|
||||||
self.fields = pd.read_sql_query("SELECT * FROM :table LIMIT 1".replace(":table",table),self.conn).columns.tolist()
|
# self.fields = pd.read_sql_query("SELECT * FROM :table LIMIT 1".replace(":table",table),self.conn).columns.tolist()
|
||||||
except Exception as e:
|
# except Exception as e:
|
||||||
pass
|
# pass
|
||||||
finally:
|
# finally:
|
||||||
pass
|
# pass
|
||||||
else:
|
# else:
|
||||||
self.fields = fields;
|
self.fields = fields;
|
||||||
|
|
||||||
def make(self,**_args):
|
def make(self,**_args):
|
||||||
|
|
Loading…
Reference in New Issue