Skip to content

fix(profiler): name a blank header cell Unnamed: N in the web engine (#1046) - #1060

Merged
yakew7 merged 1 commit into
yakew7:mainfrom
AnayDhawan:fix/1046-blank-header-name
Oct 18, 2026
Merged

yakew7 merged 1 commit into
yakew7:mainfrom
AnayDhawan:fix/1046-blank-header-name

Conversation

@AnayDhawan

Copy link
Copy Markdown
Contributor

Summary

Name a blank CSV header cell Unnamed: N (N is the zero-based column index) in the web engine, matching what pandas does, so a column has the same name in both engines.

Type

  • Audit
  • Explainer
  • Bug fix
  • Other

Audit checklist

N/A, this PR is a bug fix.


Explainer checklist

N/A, this PR is a bug fix.


Details

  • assets/profiler-engine.js dedupeHeaders() renames empty header cells to Unnamed: <index> first, then de-duplicates as before (so a blank cell next to a literal Unnamed: 1 header gets Unnamed: 1.1, same as pandas).
  • faircode/SPEC.md section 1 states the rule; the Python side already got it from pandas, so faircode/ code is unchanged.
  • tests/test_js_parity_profile_parsing.py: three new cases in the existing parser parity test (a blank cell, an all-blank header row, a blank cell next to a literal Unnamed: 1). The test compares column names against pd.read_csv and the full profile between the two engines. All three fail without the fix.

Testing

  • pytest tests/test_js_parity_profile_parsing.py -k parser_edge_cases: 8 passed (3 new).
  • Full suite on Windows: 869 passed, 20 failed. The same failures occur on unmodified upstream/main (missing mcp / fairlearn in my env, plus Windows path and subprocess issues in test_cli, test_generate_key_fold, test_render_terminal_png, test_check_generated_files_current and one compare parity case). Benchmark tests were not run (no fairlearn).

Linked issue

Closes #1046

…akew7#1046)

pandas names a blank CSV header cell 'Unnamed: N' (N is the zero-based
column index); the browser parser kept it as an empty string, so a
report from one engine could not be matched with the other. dedupeHeaders()
now renames blank cells first, then de-duplicates as before.

Adds parity cases for a blank cell, an all-blank header row, and a blank
cell next to a literal 'Unnamed: 1' header, and notes the rule in SPEC.md.
@vercel

vercel Bot commented Oct 18, 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

Copy link
Copy Markdown

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

@yakew7
yakew7 marked this pull request as ready for review October 18, 2026 05:31
@yakew7
yakew7 merged commit f0e459e into yakew7:main Oct 18, 2026
18 of 19 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.

An empty header cell is named Unnamed: 1 by pandas and an empty string by the web engine

2 participants