sdv-dev / SDMetrics

Metrics to evaluate quality and efficacy of synthetic datasets.
https://docs.sdv.dev/sdmetrics
MIT License
210 stars 45 forks source link

Better error message when passing an SDV Metadata object #610

Closed srinify closed 3 months ago

srinify commented 3 months ago

Problem Description

If you try to generate a Quality or Diagnostic report in sdmetrics by passing in an SDV metadata object, you get a somewhat unhelpful error message.

from sdmetrics.reports.multi_table import QualityReport
report = QualityReport()
report.generate(real_data, synthetic_data, etadata)

Error:

Screenshot 2024-07-23 at 3 46 08 PM

Expected behavior

After a quick chat with @npatki -- we discussed that the best solution might be to return a more useful error like:

TypeError: Expected a dictionary but received a {type} instead. 

For SDV metadata objects, please use the 'to_dict' function to convert it to a dictionary.