Skip to content

fix: HTML reports drop imbalance/missing/skew meta line and reference section - #294

Merged
yakew7 merged 1 commit into
yakew7:mainfrom
AnayDhawan:fix/report-parity-283-272
Aug 23, 2026
Merged

fix: HTML reports drop imbalance/missing/skew meta line and reference section#294
yakew7 merged 1 commit into
yakew7:mainfrom
AnayDhawan:fix/report-parity-283-272

Conversation

@AnayDhawan

Copy link
Copy Markdown
Contributor

⏸️ Paper freeze acknowledged: only faircode/report.py, tests/test_report.py, and assets/profiler-ui.js touched. No frozen file, benchmark param, or audit manifest changed.

Summary

Two related report-rendering parity bugs, both bug-labeled and independently reported:

#283 - to_html() and the web profiler's buildHtmlReport() render only the group table and flags per dimension. Neither rendered the imbalance_ratio/missing_pct/skewness meta line that to_terminal() and the on-screen web UI already show (e.g. imbalance 3.2x missing 4.0% skew +0.31). Fixed by porting the same meta-line construction from to_terminal() into to_html(), rendered as a .meta span next to the dimension score.

#272 - The web profiler's downloadable HTML report (buildHtmlReport()) omits the reference-baseline comparison section entirely, even though the live on-page results (dimCard()) and the Python CLI's --html output (faircode/report.py::to_html()) both include it. A user who uploads a reference baseline sees the "vs reference" comparison on the page but the file they download drops it. Fixed by porting the same reference-table rendering (and matching .reference CSS) from dimCard()/to_html() into buildHtmlReport().

Type

  • Bug fix

Changes

  • faircode/report.py: to_html() now builds the same meta_parts list as to_terminal() and renders it as <span class="meta">(...)</span> in each dimension's <h2>, plus the matching .meta CSS rule.
  • assets/profiler-ui.js: buildHtmlReport() now renders a .reference block per dimension (mirroring dimCard()'s ref block and to_html()'s reference_html), plus the matching .reference CSS rules ported from report.py.
  • tests/test_report.py: extended test_to_html_renders_key_figures to assert imbalance 1.6x, missing 2.0%, and skew +0.30 appear in the rendered HTML.

Test plan

Closes #283
Closes #272

… section

to_html() (faircode/report.py) and buildHtmlReport() (assets/profiler-ui.js)
both rendered the group table and flags for each dimension but omitted
fields shown everywhere else (terminal output, on-screen web results):

- to_html() never rendered the per-dimension imbalance_ratio/missing_pct/
  skewness meta line that to_terminal() already builds. Ported the same
  format into a .meta span next to the dimension score.
- buildHtmlReport()'s downloadable HTML report never rendered the
  reference-baseline section that dimCard() (live on-page results) and
  faircode/report.py::to_html() already include. Ported the same
  reference-table rendering and matching CSS.

Extends test_to_html_renders_key_figures to assert the meta line appears.

Closes yakew7#283, closes yakew7#272
@vercel

vercel Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

@AnayDhawan 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

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown

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

@ahmdkaml

Copy link
Copy Markdown
Collaborator

@yakew7 mergable.

@yakew7
yakew7 merged commit 1166074 into yakew7:main Aug 23, 2026
18 of 19 checks passed
Shreyash0712 added a commit to Shreyash0712/Fair-Code that referenced this pull request Aug 23, 2026
@Shreyash0712 Shreyash0712 mentioned this pull request Aug 23, 2026
4 tasks
yakew7 added a commit that referenced this pull request Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants