Skip to content

Commit

Permalink
fix: Solution of error of not computing all models in disaggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvazquez1988 committed Jan 10, 2025
1 parent 768af38 commit 08f06e0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions anomalywatchdog/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import pandas as pd
from typing import Union, List
from pyspark.sql import DataFrame
import numpy as np


class AnomalyWatchdog:
Expand Down Expand Up @@ -152,7 +153,7 @@ def __detect_granular_anomalies(
list_dimension_value = [
dimension for dimension
in self.df_input[column_dimension].unique()
if dimension is not None
if dimension is not (None or np.nan)
]
for dimension_value in list_dimension_value:
df_dimension = (
Expand Down Expand Up @@ -181,10 +182,9 @@ def __detect_granular_anomalies(
dimension_value
)
list_df_dimension.append(df_predictions_element)
df_dimension = pd.concat(list_df_dimension)
return df_dimension
else:
return df_dimension
if len(list_df_dimension) > 0:
df_dimension = pd.concat(list_df_dimension)
return df_dimension
else:
return df_dimension
else:
Expand Down

0 comments on commit 08f06e0

Please sign in to comment.