Skip to content

Silence method redefined warning in aggregate update exception test - #1489

Merged
suketa merged 1 commit into
mainfrom
test/silence-to-date-redefined-warning
Oct 11, 2026
Merged

suketa merged 1 commit into
mainfrom
test/silence-to-date-redefined-warning

Conversation

@suketa

@suketa suketa commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

AggregateUpdateExceptionTest#with_conversion_raising replaces DuckDB::Converter._to_date with define_singleton_method and restores it the same way. Both steps redefine an existing method, so rake test prints:

test/duckdb_test/aggregate_update_exception_test.rb:39: warning: previous definition of _to_date was here

This removes the singleton method before each redefinition, so no warning is emitted. Test behavior is unchanged.

Minitest's stub was not used because Minitest 6 moved it into the separate minitest-mock gem.

Testing

  • ruby -w -Ilib:test test/duckdb_test/aggregate_update_exception_test.rb: 3 runs, 0 failures, no warnings
  • rubocop on the file: no offenses

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated exception-test cleanup to avoid method-redefinition warnings while restoring the original conversion behavior.

Remove the singleton method before redefining it so Ruby doesn't warn
when stubbing and restoring DuckDB::Converter._to_date.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 898c5d26-b413-4b52-b349-35ecaa61ae88

📥 Commits

Reviewing files that changed from the base of the PR and between 0083118 and 6a0c379.


📒 Files selected for processing (1)
  • test/duckdb_test/aggregate_update_exception_test.rb

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



📝 Walkthrough

Walkthrough

The conversion exception test helper removes the existing _to_date method before defining a raising replacement. During cleanup, it removes the replacement before restoring the original method.

Changes

Conversion exception test

Layer / File(s) Summary
Replace and restore the conversion method
test/duckdb_test/aggregate_update_exception_test.rb
The helper removes _to_date before defining the raising replacement. Its cleanup removes that replacement before restoring the original method.

Priority: ⬇️ Low

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

Change: Other


Merge Risk: ⚪ Minimal · up to 6a0c3

This test-only change preserves the conversion method during normal cleanup. No actionable merge-blocking risk remains.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: removing the method redefinition warning in the aggregate update exception test.
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 docstrings
  • Commit to this branch
  • Create a new PR


🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@suketa
suketa merged commit 0065bff into main Oct 11, 2026
35 of 39 checks passed
@suketa
suketa deleted the test/silence-to-date-redefined-warning branch October 11, 2026 14:58
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