Skip to content

Commit 316d88c

Browse files
authored
add missing value warning
1 parent b7f1425 commit 316d88c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

causal_automl/download_eia_data.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,15 @@ def filter_series(
8888
list(df.columns),
8989
)
9090
df = df[df[key] == val]
91+
if df.empty:
92+
_LOG.warning("No data remaining after applying facets.")
9193
# Detect the metric column.
9294
_, _, _, data_identifier = self._parse_id(id_)
9395
df = df[["period", data_identifier]]
9496
# Drop rows with missing value.
9597
df = df.dropna(subset=[data_identifier])
9698
if df.empty:
97-
_LOG.warning("No data remaining after applying facets.")
99+
_LOG.warning("No data remaining after dropping NaN values.")
98100
# Convert to datetime and index.
99101
df["period"] = pd.to_datetime(df["period"]).dt.tz_localize("UTC")
100102
df = df.set_index("period")

0 commit comments

Comments
 (0)