-
Notifications
You must be signed in to change notification settings - Fork 2.3k
latest overrides package breaks allennlp #5197
Comments
Also see mkorpela/overrides#77 |
Thanks for bringing this up and doing the digging @david-waterworth. Sounds like upgrading I'm putting "Contributions welcome" on this for now because I don't think any of us will be able to get to it in the immediate future. |
In the interim would it make sense to update setup.py to require overrides<=3.1.0? Otherwise, anyone who installs allennlp from pip gets a broken install atm. It also looks like this error only occurs on methods that are overrides, and it appears you can suppress the type checking by adding |
Oh, you must be using a really old version of allennlp then? We've had it pinned since 1.0. |
Yes I'm using a third-party library that had pinned to 0.8.4, which is part of the reason for my confusions as the library is fairly new so I'm not sure why they pinned such an old version of allennlp. I've asked them to update but it's code linked to a published paper so I think they probably wont want to. I only just realised that the latest release of allennlp does pin overrides so ignore my comment. |
@david-waterworth Same here. I had to use allennlp 0.8.3 and i had the latest overrides version by default. Downgrading overrides library to 3.1.0 solved it. Thanks for your helpful comments |
Hello, I'd like to contribute to this issue. I just have some questions about the scope of the changes that are "authorized". Are change on parent classes authorized or not? (for example for the dataset_reader class)
Without modifying the parent signature, the only solution would be to remove the type declaration for child classes or forcing the flag. |
IMO class DatasetReader(Generic[T]):
...
def _read(self, input: T) -> Iterable[Instance]:
pass That would probably resolve typing/overrides issues. |
Can this be closed in light of #5490 being merged? |
Yes, thanks @ksteimel |
The version of
overrides
dependency seems to have been bumped rapidly from3.1.0
on 18 Jun 2020 to6.1.0
5 days ago (https://github.com/mkorpela/overrides/tags) with a release almost weekly. This seems to have added functionality to verify correctness of type annotations, which in turn throws exceptions on simple imports (see MRE below) which aren't annotated correctly such asArrayField.empty_field
has no return type annotation (should be the string 'ArrayField' since it returns an instance of it's class).I had to downgrade overrides to 3.1.0, I "fixed" the issue below by adding the correct return type to the
ArrayField.empty_field
property (-> 'ArrayField' works) and a few other trivial examples but then it quickly snowballed so I gave up and manually rolled back.from allennlp.data.fields import ArrayField
The text was updated successfully, but these errors were encountered: