31ac13263bbc1efc71b2e76893c82e2b8ca6c29e,lore/transformers.py,Age,transform,#Age#Any#,71

Before Change


        self.unit = unit

    def transform(self, data):
        age = (datetime.datetime.now() - self.series(data))
        if self.unit in ["nanosecond", "nanoseconds"]:
            return age
        

After Change



    def transform(self, data):
        with timer("transform %s" % self.name, logging.DEBUG):
            series = self.series(data)
            other = self.other_series(data)
            if other is None:
                other = datetime.datetime.now()
            elif other.dtype != "datetime64[ns]":
                logger.warning("%s is not a datetime. Converting to datetime64[ns]" % self.column)
                other = pandas.to_datetime(other).astype("datetime64[ns]")
    
            if series.dtype != "datetime64[ns]":
                logger.warning("%s is not a datetime. Converting to datetime64[ns]" % self.column)
                other = pandas.to_datetime(other).astype("datetime64[ns]")
    
            age = (other - self.series(data))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: instacart/lore
Commit Name: 31ac13263bbc1efc71b2e76893c82e2b8ca6c29e
Time: 2018-04-02
Author: montanalow@users.noreply.github.com
File Name: lore/transformers.py
Class Name: Age
Method Name: transform


Project Name: instacart/lore
Commit Name: 173876b2b33a06ffdfc9d7262eb5bb0d13a53b12
Time: 2018-06-28
Author: montana@instacart.com
File Name: lore/encoders.py
Class Name: Norm
Method Name: fit


Project Name: instacart/lore
Commit Name: 9475737b939d9301cacfab972fdd9957f84504c5
Time: 2017-12-18
Author: montanalow@users.noreply.github.com
File Name: lore/encoders.py
Class Name: Norm
Method Name: transform