Skip to content

Distinguish terminal labels that share a long prefix (#1038) - #1074

Merged
yakew7 merged 2 commits into
yakew7:mainfrom
sammist2:fix/1038-distinguish-colliding-long-labels
Oct 20, 2026
Merged

yakew7 merged 2 commits into
yakew7:mainfrom
sammist2:fix/1038-distinguish-colliding-long-labels

Conversation

@sammist2

@sammist2 sammist2 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1038.

The terminal renderer clips group labels to 30 characters with a trailing ellipsis. Two labels longer than that which share their first 29 characters clipped to the same text and read as a duplicated row; JSON, CSV and HTML carry the labels whole, so only the terminal was affected.

Add _clip_labels, which clips a dimension's labels together and re-clips any that would collide with a middle ellipsis (head...tail) so their differing ends stay visible. Route the profile, reference and compare terminal renderers through it. Non-colliding labels keep the plain trailing ellipsis. Adds a regression test.

Summary

Type

  • Audit
  • Explainer
  • Bug fix
  • Other

Audit checklist

  • I opened or linked a corresponding issue first
  • The folder is named after the domain, not the dataset
  • unfair.py includes protected attributes and prints the required output format
  • fair.py removes protected attributes and identified proxy variables
  • Both scripts use random_state=42 and an 80/20 train/test split
  • Proxy variables were actually tested, not just guessed
  • unfair.png and fair.png are included as PNG screenshots
  • The dataset is public and accessible without login or payment
  • The dataset file is included, or DATA.md is included if the file is too large
  • README.md includes the new results row and audit section
  • A notebook was added if the audit benefits from one

Before fairness gap:

After fairness gap:

Reduction:

Protected attribute(s):

Proxy variables dropped:


Explainer checklist

  • The file is in explainers/ and uses lowercase hyphenated naming
  • It includes a plain-language definition
  • It uses a real example from this repo or a documented real-world case
  • It includes runnable Python detection or measurement code
  • It acknowledges limitations or trade-offs
  • It links to related explainers or repo projects
  • It includes 2-3 primary sources
  • The Explainers table in README.md was updated

Linked issue

Closes #

The terminal renderer clips group labels to 30 characters with a
trailing ellipsis. Two labels longer than that which share their first
29 characters clipped to the same text and read as a duplicated row;
JSON, CSV and HTML carry the labels whole, so only the terminal was
affected.

Add _clip_labels, which clips a dimension's labels together and re-clips
any that would collide with a middle ellipsis (head...tail) so their
differing ends stay visible. Route the profile, reference and compare
terminal renderers through it. Non-colliding labels keep the plain
trailing ellipsis. Adds a regression test.
@vercel

vercel Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

@sammist2 is attempting to deploy a commit to the yashkewlani2020-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

@yakew7 @ahmdkaml - new PR touching a path you own, please review.

…ew7#1038)

test_terminal_reports_keep_long_group_labels_apart asserted that two
long labels sharing a 29-character prefix both clip to the same
'<29 chars>…' text, which is exactly the duplicated-row behavior yakew7#1038
fixes. Keep the test's intent (each label cut with a marker, the full
label never shown) but assert the two rows are now distinct.
@yakew7
yakew7 merged commit 3a8f2ca into yakew7:main Oct 20, 2026
16 of 17 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.

Two long group labels that share their first 29 characters still print identically after the ellipsis fix

2 participants