Skip to content

fix: merge high correlation alerts across correlation methods - #1870

Merged
fabclmnt merged 3 commits into
Data-Centric-AI-Community:developfrom
MohammadHijjawi97:fix/consolidate-correlation-alerts
Oct 30, 2026
Merged

fabclmnt merged 3 commits into
Data-Centric-AI-Community:developfrom
MohammadHijjawi97:fix/consolidate-correlation-alerts

Conversation

@MohammadHijjawi97

Copy link
Copy Markdown
Contributor

To be able to merge a pull request, there are a few checks:
[x] the black style should be enforced (make lint)
[ ] the docs should be regenerated (make docs)
[ ] the pull request should pass the tests (make test)
[ ] the examples should be generated (make examples)

Problem

When more than one correlation method has warn_high_correlations enabled (e.g. pearson plus the default auto), check_correlation_alerts is meant to consolidate the correlated fields per column. However, set(fields).update(...) is a no-op, and the next line overwrites the entry. The last method wins for every column, so fields flagged by an earlier method are lost and the alerts become asymmetric.

Example, with pearson enabled and one outlier shared by x and y:

  • pearson flags xy, xz and y~z;
  • auto flags only x~z.

The alerts were x: [z], y: [x, z], z: [x]. So y is reported as correlated with x, but x is not reported as correlated with y.

Solution

Merge each method's correlated fields into the column's list, keeping the order and without duplicates.

Tests

Added test_correlation_alerts_are_merged_across_methods in tests/unit/test_correlations.py; it fails before the change and passes after. Ran tests/unit/test_correlations.py, tests/unit/test_describe.py, tests/unit/test_output.py and tests/issues/test_issue824.py.

MohammadHijjawi97 and others added 2 commits September 28, 2026 19:16
When several correlation methods have warn_high_correlations enabled,
check_correlation_alerts overwrote a column's correlated fields with the
result of the last method instead of merging them (the set().update()
call was a no-op). A column could then lose fields flagged by an earlier
method, making the alerts asymmetric (y listed x, but x did not list y).
@fabclmnt
fabclmnt merged commit ead6bcc into Data-Centric-AI-Community:develop Oct 30, 2026
14 checks passed
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.

2 participants