fix warning numbers

This commit is contained in:
svlandeg 2023-07-05 10:35:41 +02:00
parent 8a79a71190
commit 0fd797e33c
2 changed files with 5 additions and 7 deletions

View File

@ -219,11 +219,9 @@ class Warnings(metaclass=ErrorsWithCodes):
W125 = ("The StaticVectors key_attr is no longer used. To set a custom "
"key attribute for vectors, configure it through Vectors(attr=) or "
"'spacy init vectors --attr'")
W126 = (
"Pipe instance '{name}' is being added with a vocab "
"instance that will not match other components. This is "
"usually an error."
)
W126 = ("Pipe instance '{name}' is being added with a vocab "
"instance that will not match other components. This is "
"usually an error.")
class Errors(metaclass=ErrorsWithCodes):

View File

@ -2427,7 +2427,7 @@ def _get_instantiated_vocab(
elif isinstance(vocab, Vocab):
for name, inst_voc in vocab_instances.items():
if inst_voc is not vocab:
warnings.warn(Warnings.W125.format(name=name))
warnings.warn(Warnings.W126.format(name=name))
return vocab
else:
resolved_vocab = None
@ -2435,7 +2435,7 @@ def _get_instantiated_vocab(
if resolved_vocab is None:
resolved_vocab = inst_voc
elif inst_voc is not resolved_vocab:
warnings.warn(Warnings.W125.format(name=name))
warnings.warn(Warnings.W126.format(name=name))
# This is supposed to only be for the type checker --
# it should be unreachable
assert resolved_vocab is not None