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

Subclass from colbert.data.Collection fails cast assertion #147

Closed
bagchisu opened this issue Dec 5, 2022 · 3 comments
Closed

Subclass from colbert.data.Collection fails cast assertion #147

bagchisu opened this issue Dec 5, 2022 · 3 comments

Comments

@bagchisu
Copy link

bagchisu commented Dec 5, 2022

The cast() classmethod in colbert.data.Collection has uses the following to test the type of the obj argument:

        if type(obj) is cls:
            return obj

This fails when the collection object passed to colbert.Searcher is a subclass of Collection. Perhaps a better implementation for the type check in cast would be:

        if isinstance(obj, cls):
            return obj
@okhat
Copy link
Collaborator

okhat commented Dec 12, 2022

Agreed. If you make a pull request I'll merge it!

@bagchisu
Copy link
Author

bagchisu commented Dec 13, 2022 via email

@okhat
Copy link
Collaborator

okhat commented Dec 19, 2022

You can create a new PR from here: https://github.com/stanford-futuredata/ColBERT/pulls

@okhat okhat closed this as completed May 3, 2023
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

No branches or pull requests

2 participants