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

Update _impact_searcher.py to use renamed java functions. #1619

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

sahel-sh
Copy link
Member

@sahel-sh sahel-sh commented Sep 5, 2023

castorini/anserini@e475cc4 renames document/documentByField functions to doc/doc_by_field. This cl changes the function calls in _impact_searcher.py to match the new names to fix the following error:

File ".../lib/python3.10/site-packages/pyserini/search/lucene/_impact_searcher.py", line 248, in doc
    lucene_document = self.object.document(docid)
AttributeError: 'io.anserini.search.SimpleImpactSearcher' object has no attribute 'document'
```

castorini/anserini@e475cc4 renames `document/documentByField` functions to `doc/doc_by_field`. This cl changes the function calls in _impact_searcher.py to match the new names to fix the following error:
````
File ".../lib/python3.10/site-packages/pyserini/search/lucene/_impact_searcher.py", line 248, in doc
    lucene_document = self.object.document(docid)
AttributeError: 'io.anserini.search.SimpleImpactSearcher' object has no attribute 'document'
```
Copy link
Member

@lintool lintool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a quick test case so these name mismatch issues don't creep back in?

@sahel-sh
Copy link
Member Author

sahel-sh commented Sep 5, 2023

Can you add a quick test case so these name mismatch issues don't creep back in?

Created an issue for the test coverage per our chat: #1621

@lintool lintool self-requested a review September 5, 2023 18:27
Copy link
Member

@lintool lintool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll circle back to add test case, but this is good for now!

@sahel-sh sahel-sh merged commit d8dc5b3 into master Sep 5, 2023
@sahel-sh sahel-sh deleted the sahel-sh-call_renamed_functions branch September 5, 2023 18:36
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.

2 participants