Skip to content

fixing the duplicate header error logging - #1093

Open
Devansh-567 wants to merge 1 commit into
OWASP:mainfrom
Devansh-567:fix/spreadsheet-duplicate-header-log
Open

Devansh-567 wants to merge 1 commit into
OWASP:mainfrom
Devansh-567:fix/spreadsheet-duplicate-header-log

Conversation

@Devansh-567

Copy link
Copy Markdown

PR fix

While reviewing the spreadsheet error handling, I noticed that the duplicate-header error handler in read_spreadsheet() was passing a value to logger.error() without a %s placeholder in the message.

This caused the logging call itself to raise a TypeError instead of showing the duplicate header, which masked the original spreadsheet error.

issue is here:
logger.error(
"If this exception says you have a duplicate cell name, the duplicate is",
findDups(wsh.row_values(1)),
)

The message needs a %s placeholder for the duplicate value.

Testing

I verified that test_read_spreadsheet_duplicate_headers now passes.

The full test suite passes with:

  • 998 passed, 6 skipped, 0 failures

Signed-off-by: Devansh-567 <devansh.jay.singh@gmail.com>
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Advanced

Run ID: 27586d11-377e-42a7-bb37-39214f02806a

📥 Commits

Reviewing files that changed from the base of the PR and between 5a3c384 and fa84422.

📒 Files selected for processing (1)
  • application/utils/spreadsheet.py

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


Summary by CodeRabbit

  • Bug Fixes
    • Improved the duplicate-cell error message by adding clearer punctuation before the reported duplicate names.

Walkthrough

The read_spreadsheet duplicate-cell error message now includes a colon before the reported duplicate names.

Changes

Spreadsheet error formatting

Layer / File(s) Summary
Duplicate-cell message update
application/utils/spreadsheet.py
The duplicate-cell error message now ends with is: before the duplicate names.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to fa844

The duplicate-header error is now logged without masking the original spreadsheet error. The focused and full test suites pass.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the duplicate-header logging defect, the %s placeholder fix, and the test results. It is directly related to the changeset.
Title check ✅ Passed The title clearly identifies the main change: fixing duplicate-header error logging in the spreadsheet reader.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant