From e3c6f98fa5411d6e3d2b2a8b6f3ca55829decdbe Mon Sep 17 00:00:00 2001 From: Vitaly Gavensky Date: Mon, 30 Sep 2024 10:21:48 +0300 Subject: [PATCH] Types check in delta calculation --- .../ufm_sim_web_service/telemetry_collector.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/pdr_deterministic_plugin/ufm_sim_web_service/telemetry_collector.py b/plugins/pdr_deterministic_plugin/ufm_sim_web_service/telemetry_collector.py index 74debe51..11fcfce2 100644 --- a/plugins/pdr_deterministic_plugin/ufm_sim_web_service/telemetry_collector.py +++ b/plugins/pdr_deterministic_plugin/ufm_sim_web_service/telemetry_collector.py @@ -57,8 +57,10 @@ def _get_delta(self, first_df: pd.DataFrame, second_df:pd.DataFrame): merged_df = pd.merge(second_df, first_df, on=self.BASED_COLUMNS, how='inner', suffixes=('', '_x')) delta_dataframe = pd.DataFrame() for _,col in enumerate(second_df.columns): - if col not in self.KEY: - col_x = col + "_x" + col_x = col + "_x" + if col not in self.KEY\ + and not merged_df[col].apply(lambda x: isinstance(x, str)).any()\ + and not merged_df[col_x].apply(lambda x: isinstance(x, str)).any(): try: delta_dataframe[col] = merged_df[col] - merged_df[col_x] except TypeError: