fix: HTML reports drop imbalance/missing/skew meta line and reference section - #294
Merged
Merged
Conversation
… 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
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. |
|
@yakew7 @ahmdkaml - new PR touching a path you own, please review. |
ahmdkaml
approved these changes
Aug 23, 2026
Collaborator
|
@yakew7 mergable. |
Shreyash0712
added a commit
to Shreyash0712/Fair-Code
that referenced
this pull request
Aug 23, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related report-rendering parity bugs, both bug-labeled and independently reported:
#283 -
to_html()and the web profiler'sbuildHtmlReport()render only the group table and flags per dimension. Neither rendered theimbalance_ratio/missing_pct/skewnessmeta line thatto_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 fromto_terminal()intoto_html(), rendered as a.metaspan 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--htmloutput (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.referenceCSS) fromdimCard()/to_html()intobuildHtmlReport().Type
Changes
faircode/report.py:to_html()now builds the samemeta_partslist asto_terminal()and renders it as<span class="meta">(...)</span>in each dimension's<h2>, plus the matching.metaCSS rule.assets/profiler-ui.js:buildHtmlReport()now renders a.referenceblock per dimension (mirroringdimCard()'srefblock andto_html()'sreference_html), plus the matching.referenceCSS rules ported fromreport.py.tests/test_report.py: extendedtest_to_html_renders_key_figuresto assertimbalance 1.6x,missing 2.0%, andskew +0.30appear in the rendered HTML.Test plan
python -m pytest tests/test_report.py -q- 19 passedpython -m pytest -q(full suite) - 169 passed, 20 skipped, no regressionsassets/profiler-ui.jshas no Python-side test harness beyondtest_js_parity.py(which coversprofiler-engine.js, notprofiler-ui.js), so the Web profiler's downloadable HTML report omits the reference-baseline section that the live page and CLI both include #272 fix is verified by code inspection againstdimCard()'s existing reference-rendering path plusreport.py::to_html()'s equivalent block, which it now matches structurally.Closes #283
Closes #272