Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Duplicate action method with the same name #230

Closed
Earlopain opened this issue Mar 1, 2024 · 2 comments
Closed

[BUG] Duplicate action method with the same name #230

Earlopain opened this issue Mar 1, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Earlopain
Copy link
Collaborator

What is the bug?

delete_by_query_rethrottle.rb and delete_by_rethrottle.rb both define delete_by_query_rethrottle. This causes a ruby warning to be emitted when running with -w. Example output when running the test suite here:

[earlopain@DESKTOP-PC opensearch-ruby]$ RUBYOPT=-w bundle exec rake test:transport:unit
...
/home/earlopain/Documents/opensearch-ruby/lib/opensearch/api/actions/delete_by_rethrottle.rb:36: warning: method redefined; discarding old delete_by_query_rethrottle
/home/earlopain/Documents/opensearch-ruby/lib/opensearch/api/actions/delete_by_query_rethrottle.rb:37: warning: previous definition of delete_by_query_rethrottle was here
...

Finished in 0.20590s
109 tests, 236 assertions, 0 failures, 0 errors, 0 skips

Clearly one of these is wrong. I'm however not knowledgable enough to say what the correct version would be.

This doesn't actually impact me, apart from these messages appearing in my test logs when running tests with warnings in my own project.

@Earlopain Earlopain added bug Something isn't working untriaged labels Mar 1, 2024
@nhtruong
Copy link
Collaborator

Nice catch. Looks like only delete_by_query_rethrottle shows up in the Spec. Also the name of the file should match the name of the action. So 2 reasons to delete delete_by_rethrottle.rb

@Earlopain
Copy link
Collaborator Author

Thanks for the feedback, I have openend #236 to resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants