open-semantic-etl
open-semantic-etl copied to clipboard
process() got multiple values for argument 'parameters'
Hi,
I'm developing a data enhancer plugin , as describer at
but the following error is thrown while indexing files
Exception while data enrichment of arquivos_indexados/a.xml with plugin teste: process() got multiple values for argument 'parameters'
what is going wrong here? is there another way? the code is bellow
regards
import re
class teste(object):
def process(parameters={}, data={} ):
# regular expression matching email-adresses
regex = r'https?://(?:[-\w.]|(?:%[\da-fA-F]{2}))+'
# facet / column where to store/index it
facet = "URL_ss"
# find all emailadresses with a regular expression
matches = re.findall(regex, parameters['text'])
if matches:
# add the list matches to the facet
opensemanticsearch_connector.append(data, facet, matches)
return parameters, data
I noticed this might be a python related issue adding self to the process method signature solved the problem
import re
class teste(object):
def process(self, parameters={}, data={} ):
# regular expression matching email-adresses
regex = r'https?://(?:[-\w.]|(?:%[\da-fA-F]{2}))+'
# facet / column where to store/index it
facet = "URL_ss"
# find all emailadresses with a regular expression
matches = re.findall(regex, parameters['text'])
if matches:
# add the list matches to the facet
opensemanticsearch_connector.append(data, facet, matches)
return parameters, data