Skip to content

Commit

Permalink
Types check in delta calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
vg12345 committed Sep 30, 2024
1 parent e3c6f98 commit edb2358
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit edb2358

Please sign in to comment.