Repository navigation
fix(profiler): name a blank header cell Unnamed: N in the web engine (#1046) - #1060
Merged
Merged
Conversation
…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.
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. |
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
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 checklist
N/A, this PR is a bug fix.
Explainer checklist
N/A, this PR is a bug fix.
Details
assets/profiler-engine.jsdedupeHeaders()renames empty header cells toUnnamed: <index>first, then de-duplicates as before (so a blank cell next to a literalUnnamed: 1header getsUnnamed: 1.1, same as pandas).faircode/SPEC.mdsection 1 states the rule; the Python side already got it from pandas, sofaircode/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 literalUnnamed: 1). The test compares column names againstpd.read_csvand 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).upstream/main(missingmcp/fairlearnin my env, plus Windows path and subprocess issues intest_cli,test_generate_key_fold,test_render_terminal_png,test_check_generated_files_currentand one compare parity case). Benchmark tests were not run (nofairlearn).Linked issue
Closes #1046