Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process() got multiple values for argument 'parameters' #81

Open
ronniebrito opened this issue Mar 8, 2019 · 1 comment
Open

process() got multiple values for argument 'parameters' #81

ronniebrito opened this issue Mar 8, 2019 · 1 comment

Comments

@ronniebrito
Copy link

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
Copy link
Author

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


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

No branches or pull requests

1 participant