sense2vec icon indicating copy to clipboard operation
sense2vec copied to clipboard

Nonetype error

Open smyja opened this issue 3 years ago • 2 comments

This fixes the nonetype error it throws when the submitted text is problematic.

smyja avatar Aug 27 '22 00:08 smyja

Hi @Smyja, have you had time to look into this question I wrote earlier?

Can you add a unit test that breaks before the PR, and is fixed with it?

The typing of most_similar doesn't actually allow None as a valid value for keys, so I wonder when this comes up. If it happens internally, that might be a bug (and we should raise an error instead of silently continuing). If it's not considered a bug, perhaps we need to expand the typing.

svlandeg avatar Sep 13 '22 16:09 svlandeg

Hi @Smyja, have you had time to look into this question I wrote earlier?

Can you add a unit test that breaks before the PR, and is fixed with it? The typing of most_similar doesn't actually allow None as a valid value for keys, so I wonder when this comes up. If it happens internally, that might be a bug (and we should raise an error instead of silently continuing). If it's not considered a bug, perhaps we need to expand the typing.

For badly formatted texts, you'd get a nonetype error. Can't get the tests folder to run without failing, I'll keep trying it.

smyja avatar Sep 17 '22 10:09 smyja

For badly formatted texts, you'd get a nonetype error.

Can you please give an actual code snippet as example?

svlandeg avatar Sep 27 '22 08:09 svlandeg

Closing this due to lack of a response. @Smyja If you are still working on this, feel free to open a new PR - we'd welcome your contribution! :slightly_smiling_face:

rmitsch avatar Oct 17 '22 12:10 rmitsch