Skip to content

Commit

Permalink
progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Palazzo committed Nov 2, 2023
1 parent a5afedd commit 39007d1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _generate_details(self, real_data, synthetic_data, metadata, progress_bar=No
for relation in metadata.get('relationships', []):
real_columns = self._extract_tuple(real_data, relation)
synthetic_columns = self._extract_tuple(synthetic_data, relation)
for idx, metric in enumerate(metrics):
for metric in metrics:
try:
relation_score = metric.compute(
real_columns,
Expand All @@ -53,9 +53,6 @@ def _generate_details(self, real_data, synthetic_data, metadata, progress_bar=No
except Exception as e:
relation_score = np.nan
error_message = f'{type(e).__name__}: {e}'
finally:
if progress_bar is not None and idx % 2 == 0:
progress_bar.update()

child_tables.append(relation['child_table_name'])
parent_tables.append(relation['parent_table_name'])
Expand All @@ -65,6 +62,9 @@ def _generate_details(self, real_data, synthetic_data, metadata, progress_bar=No
scores.append(relation_score)
error_messages.append(error_message)

if progress_bar:
progress_bar.update()

self.details = pd.DataFrame({
'Parent Table': parent_tables,
'Child Table': child_tables,
Expand Down

0 comments on commit 39007d1

Please sign in to comment.