Skip to content

Commit

Permalink
attempt workaround to datetime bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamar Grey committed Feb 14, 2024
1 parent 30c85f3 commit 8f43115
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions featuretools/entityset/entityset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import copy
import logging
from pdb import set_trace
import warnings
from collections import defaultdict

Expand Down Expand Up @@ -1218,6 +1219,8 @@ def add_last_time_indexes(self, updated_dataframes=None):
)

if lti_is_dask or lti_is_spark:
# if child_df.ww.name == "sessions":
# set_trace()
to_join = child_df[link_col]
if lti_is_dask:
to_join.index = child_df[child_df.ww.index]
Expand All @@ -1235,6 +1238,7 @@ def add_last_time_indexes(self, updated_dataframes=None):
lti_df = lti_df.groupby(lti_df[dataframe.ww.index]).agg("max")

lti_df = (
# date
es_lti_dict[dataframe.ww.name]
.to_frame(name="last_time_old")
.join(lti_df)
Expand Down Expand Up @@ -1269,11 +1273,11 @@ def add_last_time_indexes(self, updated_dataframes=None):
lti_df = pd.Series([], dtype="object")
else:
if lti_is_spark:
lti_df["last_time"] = ps.to_datetime(lti_df["last_time"])
lti_df["last_time_old"] = ps.to_datetime(
lti_df["last_time_old"],
)
# TODO: Figure out a workaround for fillna and replace
if lti_df["last_time_old"].dtype == "float64":
lti_df["last_time_old"] = ps.to_datetime(lti_df["last_time_old"])
if lti_df["last_time"].dtype == "float64":
lti_df["last_time"] = ps.to_datetime(lti_df["last_time"])
lti_df = lti_df.max(axis=1)
else:
lti_df["last_time"] = lti_df["last_time"].astype(
Expand Down

0 comments on commit 8f43115

Please sign in to comment.