Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't call string replace on an empty dataframe #485

Merged
merged 2 commits into from
Oct 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,13 @@ def _generate_details(self, real_data, synthetic_data, metadata, progress_bar=No
denormalized_real, denormalized_synthetic, merged_metadata,
progress_bar=progress_bar, column_pairs=parent_child_pairs
)

details['Parent Table'] = parent
details['Child Table'] = child
details['Foreign Key'] = foreign_key
details['Column 1'] = details['Column 1'].str.replace(f'{parent}.', '', n=1)
details['Column 2'] = details['Column 2'].str.replace(f'{child}.', '', n=1)

if not details.empty:
details['Column 1'] = details['Column 1'].str.replace(f'{parent}.', '', n=1)
details['Column 2'] = details['Column 2'].str.replace(f'{child}.', '', n=1)
amontanez24 marked this conversation as resolved.
Show resolved Hide resolved
all_details.append(details)

self.details = pd.concat(all_details, axis=0).reset_index(drop=True)
Expand Down
Loading