bugfix: logs for formatting dates
This commit is contained in:
parent
1ff4145eea
commit
febcaa5883
|
@ -263,6 +263,7 @@ class Generator (Learner):
|
|||
|
||||
pass
|
||||
def format(self,_df,_schema):
|
||||
r = {}
|
||||
for _item in _schema :
|
||||
name = _item['name']
|
||||
|
||||
|
@ -273,9 +274,12 @@ class Generator (Learner):
|
|||
else:
|
||||
if _item['type'] == ['DATETIME','TIMESTAMP'] :
|
||||
FORMAT = '%Y-%d-%m %H:%M:%S'
|
||||
self.log(**{'action':'format','input':{'name':name,'format':FORMAT}})
|
||||
r[name] = FORMAT
|
||||
|
||||
|
||||
_df[name] = pd.to_datetime(_df[name], format=FORMAT).astype(str) #.astype('datetime64[ns]')
|
||||
if r :
|
||||
self.log(**{'action':'format','input':r})
|
||||
return _df
|
||||
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue