Skip to content

Commit

Permalink
Revert "Removed whitespaces removal (#1065)" (#1085)
Browse files Browse the repository at this point in the history
This reverts commit 105f461.
  • Loading branch information
marcinpurtak authored Oct 9, 2024
1 parent d406f2f commit c8837fd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/viadot/sources/sap_rfc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,12 @@ def to_df(self, tests: dict | None = None) -> pd.DataFrame: # noqa: C901, PLR09
):
df_tmp = pd.DataFrame(columns=fields)
df_tmp[fields] = records
# SAP adds whitespaces to the first extracted column value.
# If whitespace is in unique column, it must be removed to make
# a proper merge.
for col in self.rfc_unique_id:
df_tmp[col] = df_tmp[col].str.strip()
df[col] = df[col].str.strip()
df = pd.merge(df, df_tmp, on=self.rfc_unique_id, how="outer")
elif not start:
df[fields] = records
Expand Down

0 comments on commit c8837fd

Please sign in to comment.