getting syntax error from nifi ExecuteScript processor inspite of correct python code

Viewed 256

I am getting below error inspite of correct python code don't know how to resolve this error. Any help is much appreciated

org.apache.nifi.processor.exception.ProcessException: javax.script.ScriptException: SyntaxError: no viable alternative at input '*' in <script> at line number 35 at column number 26

python code

def get_match_list(regEx, line):
    match = re.search(regEx, line)
    print(match)
    if match:
        match_list = [*match.groups()] # this is the line exception is pointed
        return match_list
    else:
        return []
1 Answers

It looks like jython use python 2.7 and as Unpacking Generalizations is a feature that introduced in python 3.5 you can not use this syntax in jython, so an alternative way to convert a tuple to a list is that use list ( match.groups) it works fine in older versions of python and current version of jython (2.7.2)

Related