Skip to content

Allow ReferentialIntegrity metric to work on composite keys#859

Merged
pvk-developer merged 6 commits intofeature/composite-keysfrom
issue-838-allow-the-referential-integrity-metric-to-work-with-composite-keys
Mar 4, 2026
Merged

Allow ReferentialIntegrity metric to work on composite keys#859
pvk-developer merged 6 commits intofeature/composite-keysfrom
issue-838-allow-the-referential-integrity-metric-to-work-with-composite-keys

Conversation

@pvk-developer
Copy link
Member

Resolves #838
CU-86b8atdg7

@pvk-developer pvk-developer requested a review from a team as a code owner March 2, 2026 19:08
@pvk-developer pvk-developer requested review from sarahmish and removed request for a team March 2, 2026 19:08
@sdv-team
Copy link
Contributor

sdv-team commented Mar 2, 2026

@pvk-developer pvk-developer requested a review from frances-h March 2, 2026 19:08
@pvk-developer pvk-developer self-assigned this Mar 2, 2026
Copy link
Contributor

@sarahmish sarahmish left a comment

Choose a reason for hiding this comment

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

Maybe add a test for compute_breakdown with composite keys that have null values? This should include when the entire both keys are null and one only a single key is null in the composite key

how='left',
left_on=fk_columns,
right_on=pk_columns,
indicator=INDICATOR_NAME,
Copy link
Contributor

Choose a reason for hiding this comment

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

what if INDICATOR_NAME is part of existing columns? Maybe you can create a temporary indicator using _create_unique_name?

indicator = _create_unique_name(
    INDICATOR_NAME, pk_columns + fk_columns
)

Copy link
Contributor

@sarahmish sarahmish Mar 3, 2026

Choose a reason for hiding this comment

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

@pvk-developer I was referring to an already existing function in sdv._utils, similar to how it's being used here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 64166c9

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.73%. Comparing base (c3ed586) to head (6ff71f7).
⚠️ Report is 5 commits behind head on feature/composite-keys.

Additional details and impacted files
@@                    Coverage Diff                     @@
##           feature/composite-keys     #859      +/-   ##
==========================================================
+ Coverage                   95.72%   95.73%   +0.01%     
==========================================================
  Files                         117      117              
  Lines                        4914     4927      +13     
==========================================================
+ Hits                         4704     4717      +13     
  Misses                        210      210              
Flag Coverage Δ
integration 80.84% <33.33%> (-0.14%) ⬇️
unit 84.45% <100.00%> (+0.04%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@pvk-developer pvk-developer changed the title Fix lint and update ReferentialIntegrity Allow ReferentialIntegrity metric to work on composite keys Mar 2, 2026
@pvk-developer pvk-developer requested a review from sarahmish March 3, 2026 15:32
Copy link
Contributor

@sarahmish sarahmish left a comment

Choose a reason for hiding this comment

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

Left one comment to make the condition easier to read, but this is ready for merge

@pvk-developer pvk-developer merged commit cec3fa4 into feature/composite-keys Mar 4, 2026
57 checks passed
@pvk-developer pvk-developer deleted the issue-838-allow-the-referential-integrity-metric-to-work-with-composite-keys branch March 4, 2026 17:42
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.

4 participants