Skip to content

Commit e79536f

Browse files
committed
remove some logging, improve null check
1 parent e667da2 commit e79536f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

python/common/recluster.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,8 @@ def ui_related_var_modifications(df: pd.DataFrame, seasons_and_months: dict, DEP
476476
pd.DataFrame: clusters with ui related variables
477477
"""
478478
df["tst_median"] = pd.to_datetime(df["tst_median"], format="%Y-%m-%d %H:%M:%S", errors="coerce")
479-
logger.debug(df["tst_median"])
480479
df["year"] = df["tst_median"].dt.year
481480
df["season"] = df["tst_median"].dt.month.map(lambda x: get_season(x, seasons_and_months))
482-
logger.debug(df["season"])
483481
for k, v in DCLASS_NAMES.items():
484482
df["dclass"] = df["dclass"].replace(k, v)
485483

python/common/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import pandas as pd
12
import logging as logger
23
from datetime import date, datetime, timedelta, timezone
34
from typing import Tuple
@@ -55,7 +56,7 @@ def get_target_oday(offset=1):
5556
def get_season(month, seasons_and_months):
5657
logger.debug(month)
5758
logger.debug(seasons_and_months)
58-
if month is None:
59+
if month is None or pd.isna(month):
5960
return None
6061

6162
key = [key for key, val in seasons_and_months.items() if month in val][0]

0 commit comments

Comments
 (0)