Where: faircode/report.py's to_html (single-profile HTML report, dimension table rendering) vs to_terminal and compare_to_html in the same file.
The gap: to_terminal and compare_to_html both emit a "... and N more groups" note (DISPLAY_GROUPS = 12) when a dimension has more groups than the display cap. to_html's single-profile report has no equivalent - it silently renders only the first 12 groups with zero indication more exist.
Repro:
>>> import pandas as pd
>>> from faircode import profile
>>> from faircode.report import to_html
>>> df = pd.DataFrame({'region': [f'city_{i}' for i in range(20) for _ in range(5)]})
>>> result = profile(df, overrides={'region': 'geography'})
>>> html = to_html(result)
>>> result['dimensions'][0]['n_groups']
20
>>> 'more groups' in html
False
>>> 'dim-more' in html
False
Why it matters: a shared HTML report is the artifact most likely to be handed to a non-technical stakeholder, and it can look like a complete demographic breakdown while silently hiding up to 8+ groups - inconsistent with the terminal and compare renderers of the exact same data.
Suggested fix: add the same if len(d["groups"]) > DISPLAY_GROUPS: truncation note inside to_html's dimension-block loop, mirroring compare_to_html's existing .dim-more div (faircode/report.py around line 391-392).
Where:
faircode/report.py'sto_html(single-profile HTML report, dimension table rendering) vsto_terminalandcompare_to_htmlin the same file.The gap:
to_terminalandcompare_to_htmlboth emit a"... and N more groups"note (DISPLAY_GROUPS = 12) when a dimension has more groups than the display cap.to_html's single-profile report has no equivalent - it silently renders only the first 12 groups with zero indication more exist.Repro:
Why it matters: a shared HTML report is the artifact most likely to be handed to a non-technical stakeholder, and it can look like a complete demographic breakdown while silently hiding up to 8+ groups - inconsistent with the terminal and compare renderers of the exact same data.
Suggested fix: add the same
if len(d["groups"]) > DISPLAY_GROUPS:truncation note insideto_html's dimension-block loop, mirroringcompare_to_html's existing.dim-morediv (faircode/report.pyaround line 391-392).