From febcaa588395f5ee84c4cc7bec08683ba368d765 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Thu, 14 Apr 2022 12:42:11 -0500 Subject: [PATCH] bugfix: logs for formatting dates --- data/maker/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/data/maker/__init__.py b/data/maker/__init__.py index 2b53def..2921b46 100644 --- a/data/maker/__init__.py +++ b/data/maker/__init__.py @@ -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