Skip to content

Commit

Permalink
update def
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Palazzo committed Jul 29, 2024
1 parent 9d5f503 commit a0bfd57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion sdmetrics/reports/base_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ def generate(self, real_data, synthetic_data, metadata, verbose=True):
Whether or not to print report summary and progress.
"""
if not isinstance(metadata, dict):
raise TypeError('The provided metadata is not a dictionary.')
raise TypeError(
f"Expected a dictionary but received a '{type(metadata).__name__}' instead."
" For SDV metadata objects, please use the 'to_dict' function to convert it to a dictionary."
)

self._validate(real_data, synthetic_data, metadata)
self.convert_datetimes(real_data, synthetic_data, metadata)
Expand Down
4 changes: 3 additions & 1 deletion sdmetrics/reports/multi_table/base_multi_table_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ def generate(self, real_data, synthetic_data, metadata, verbose=True):
verbose (bool):
Whether or not to print report summary and progress.
"""
results = super().generate(real_data, synthetic_data, metadata, verbose)
self.table_names = list(metadata.get('tables', {}).keys())
return super().generate(real_data, synthetic_data, metadata, verbose)

return results

def _check_table_names(self, table_name):
if table_name not in self.table_names:
Expand Down

0 comments on commit a0bfd57

Please sign in to comment.