From 9a1d3b63fbd8d90c41cbccac9f127950bbbb4c52 Mon Sep 17 00:00:00 2001 From: Matt Upson Date: Fri, 4 May 2018 17:47:02 +0100 Subject: [PATCH] Add missing default to .set_extension (#2297) Failing to set a default, method, or getter results in a ValueError: ValueError: [E083] Error setting extension: only one of `default`, `method`, or `getter` (plus optional `setter`) is allowed. Got: 0 --- examples/pipeline/custom_component_countries_api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/pipeline/custom_component_countries_api.py b/examples/pipeline/custom_component_countries_api.py index 1a6dc3e42..50abfe530 100644 --- a/examples/pipeline/custom_component_countries_api.py +++ b/examples/pipeline/custom_component_countries_api.py @@ -68,9 +68,9 @@ class RESTCountriesComponent(object): # the matches, so we're only setting a default value, not a getter. # If no default value is set, it defaults to None. Token.set_extension('is_country', default=False) - Token.set_extension('country_capital') - Token.set_extension('country_latlng') - Token.set_extension('country_flag') + Token.set_extension('country_capital', default=False) + Token.set_extension('country_latlng', default=False) + Token.set_extension('country_flag', default=False) # Register attributes on Doc and Span via a getter that checks if one of # the contained tokens is set to is_country == True.