Skip to content

Make single table metrics that require metadata also accept a table name - #905

Open
fealho wants to merge 3 commits into
mainfrom
issue-891-table-name-parameter
Open

Make single table metrics that require metadata also accept a table name#905
fealho wants to merge 3 commits into
mainfrom
issue-891-table-name-parameter

Conversation

@fealho

@fealho fealho commented Aug 12, 2026

Copy link
Copy Markdown
Member

CU-86bb1gwt1, Resolve #891

@sdv-team

Copy link
Copy Markdown
Contributor

@fealho
fealho marked this pull request as ready for review August 12, 2026 17:04
@fealho
fealho requested a review from a team as a code owner August 12, 2026 17:05
@fealho
fealho requested review from R-Palazzo and sarahmish and removed request for a team August 12, 2026 17:05
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.54839% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.65%. Comparing base (f96f857) to head (d80808c).

Files with missing lines Patch % Lines
sdmetrics/single_table/efficacy/mlefficacy.py 0.00% 3 Missing ⚠️
sdmetrics/single_table/base.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #905      +/-   ##
==========================================
+ Coverage   95.63%   95.65%   +0.01%     
==========================================
  Files         122      122              
  Lines        5227     5267      +40     
==========================================
+ Hits         4999     5038      +39     
- Misses        228      229       +1     
Flag Coverage Δ
integration 80.61% <87.09%> (+0.01%) ⬆️
unit 84.81% <82.25%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sarahmish sarahmish left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Comment thread sdmetrics/single_table/bayesian_network.py Outdated
Comment thread sdmetrics/single_table/bayesian_network.py Outdated
Comment thread sdmetrics/single_table/gaussian_mixture.py Outdated
Comment thread sdmetrics/single_table/new_row_synthesis.py Outdated
Comment thread sdmetrics/single_table/new_row_synthesis.py Outdated
return metadata, table_name

tables = metadata['tables']
_validate_metadata_dict(tables)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wasn't this already validated since _validate_metadata_dict(metadata) passes at this point?

@fealho fealho Aug 16, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_validate_metadata_dict(metadata) just confirms metadata a dict, but tables could be a list.

This case still needs to be checked: metadata = {'tables': []}

Comment on lines +71 to +72
if not table_names:
raise ValueError('Metadata does not contain any tables.')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would _validate_metadata_dict pass if there are no tables? If so, can you add that to the unit tests?

@fealho
fealho force-pushed the issue-891-table-name-parameter branch from 21835ca to 82480f2 Compare August 16, 2026 22:29
@fealho
fealho requested a review from sarahmish August 16, 2026 22:34
@fealho
fealho force-pushed the issue-891-table-name-parameter branch from 82480f2 to d80808c Compare August 16, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Single table metrics that require metadata should also accept a table name

3 participants