KEMBAR78
Resolves #10542 Add fullname of node that is still a PlaceholderNode when assertion fails by TheCleric · Pull Request #10565 · python/mypy · GitHub
Skip to content

Conversation

TheCleric
Copy link
Contributor

Description

#10542 had a vague error come up due to a PlaceholderNode that did not get replaced. This PR simply adds the full name of the node so that these can be better traced back.

The error was:

...
    assert not isinstance(self.node, PlaceholderNode)
AssertionError

Will now be slightly more helpful:

...
    assert not isinstance(self.node, PlaceholderNode), '%s' % fullname
AssertionError: spacy.ml.models.multi_task.Doc

There's the possibility that something bigger needs to happen here (why is it still a PlaceholderNode?), but this was enough to help me to figure out how to move #10542 forward.

Test Plan

Manually tested with the code provided by @ZeeD from spacy import load ran through mypy with --strict

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Thanks!

@hauntsaninja hauntsaninja merged commit 4da09c7 into python:master May 31, 2021
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