From cbeac8b7243e1ac82b17272e3c6fd00a3c2f84b4 Mon Sep 17 00:00:00 2001 From: Ilya Sytchev Date: Mon, 28 Oct 2024 17:39:53 -0400 Subject: [PATCH 1/2] Upgrade setup-python GH Action to avoid deprecation warning --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index dd4dfb23..14095b7e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -15,7 +15,7 @@ jobs: - name: Check out Forest code uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 - name: Install documentation build dependencies From 47bb39e5d62b2c2f33ee4ff39fe7f3c835e461fb Mon Sep 17 00:00:00 2001 From: Ilya Sytchev Date: Tue, 29 Oct 2024 15:55:10 -0400 Subject: [PATCH 2/2] Address FutureWarning in Sycamore (#264) --- 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