From edb23583efb2ddf8a31e43eb7affc6943efd7442 Mon Sep 17 00:00:00 2001 From: Vitaly Gavensky Date: Mon, 30 Sep 2024 10:30:23 +0300 Subject: [PATCH] Types check in delta calculation --- .../ufm_sim_web_service/telemetry_collector.py | 6 +++--- 1 file changed, 3 insertions(+), 3 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 11fcfce2..d7f2dc2c 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 @@ -58,9 +58,9 @@ def _get_delta(self, first_df: pd.DataFrame, second_df:pd.DataFrame): delta_dataframe = pd.DataFrame() for _,col in enumerate(second_df.columns): 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(): + if col not in self.KEY \ + and merged_df[col].dtype != 'object' \ + and merged_df[col_x].dtype != 'object': try: delta_dataframe[col] = merged_df[col] - merged_df[col_x] except TypeError: