From 0f385409fe3c1796a8590b0e1aeaf6bef6b4414b Mon Sep 17 00:00:00 2001 From: Ilya Sytchev Date: Mon, 28 Oct 2024 15:23:30 -0400 Subject: [PATCH] Address FutureWarning in Sycamore --- forest/sycamore/common.py | 4 +--- forest/sycamore/submits.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/forest/sycamore/common.py b/forest/sycamore/common.py index e8bb1aa5..8cc29fe8 100644 --- a/forest/sycamore/common.py +++ b/forest/sycamore/common.py @@ -414,9 +414,7 @@ def aggregate_surveys_config( config_surveys[["config_id", "question_id"]], how="left", left_on="question id", right_on="question_id" ).drop(["question_id"], axis=1) - df_merged["config_id_update"] = df_merged["config_id"].fillna( - method="ffill" - ) + df_merged["config_id_update"] = df_merged["config_id"].ffill() df_merged["config_id"] = df_merged.apply( lambda row: row["config_id_update"] if row["event"] in ["User hit submit", diff --git a/forest/sycamore/submits.py b/forest/sycamore/submits.py index 72f5bf46..3add2128 100644 --- a/forest/sycamore/submits.py +++ b/forest/sycamore/submits.py @@ -525,7 +525,7 @@ def summarize_submits(submits_df: pd.DataFrame, if timeunit == Frequency.DAILY: submits["delivery_time_floor"] = submits["delivery_time"].dt.floor("D") elif timeunit == Frequency.HOURLY: - submits["delivery_time_floor"] = submits["delivery_time"].dt.floor("H") + submits["delivery_time_floor"] = submits["delivery_time"].dt.floor("h") if timeunit is not None: # round to the nearest desired unit submits["year"] = submits["delivery_time_floor"].dt.year