open-semantic-etl icon indicating copy to clipboard operation
open-semantic-etl copied to clipboard

process() got multiple values for argument 'parameters'

Open ronniebrito opened this issue 5 years ago • 1 comments

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

ronniebrito avatar Mar 08 '19 19:03 ronniebrito

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


ronniebrito avatar Mar 18 '19 21:03 ronniebrito