You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2022/11/02 20:20:00 UTC

[jira] [Commented] (NIFI-10287) ExecuteScript processor not supporting Module Directory for python

    [ https://issues.apache.org/jira/browse/NIFI-10287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17627968#comment-17627968 ] 

ASF subversion and git services commented on NIFI-10287:
--------------------------------------------------------

Commit f4069ab77aafbebfd806a17791773a7201fe7404 in nifi's branch refs/heads/main from Nissim Shiman
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=f4069ab77a ]

NIFI-10287 ExecuteScript - Allow python scripts to use external modules

Co-authored-by: Nissim Shiman <ns...@yahoo.com>
Co-authored-by: dan-s1 <ds...@gmail.com>

NIFI-10287 changes for code review

NIFI-10287 modification based on reviewer comment

Signed-off-by: Matthew Burgess <ma...@apache.org>

This closes #6254


> ExecuteScript processor not supporting Module Directory for python
> ------------------------------------------------------------------
>
>                 Key: NIFI-10287
>                 URL: https://issues.apache.org/jira/browse/NIFI-10287
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.15.3
>            Reporter: Nissim Shiman
>            Assignee: Nissim Shiman
>            Priority: Major
>          Time Spent: 4h 10m
>  Remaining Estimate: 0h
>
> The ExecuteScript processor currently does not support pointing to python modules.
> The Module Directory property is unable to find/process modules it is set to. See below [1] for example
> Also, if Module Directory property is set to /usr/lib/python<version number> (or wherever python packages are installed) the processor will AdminYield when flowfile passes through.
>  
>  
>  
> [1] Set processor properties:
> _Script Engine_ to python
> _Script Body_ to
> {code:java}
> import hello
> flowFile = session.get()
> flowFile = session.putAttribute(flowFile,"helloKey",hello.hello())
> session.transfer(flowFile, REL_SUCCESS)
> {code}
> _Module Directory_  to /tmp/testModule
> where /tmp/testModule has a file in it named hello.py 
> with the code
> {code:java}
> def hello():
>   return "hello"
> {code}
> and pass a flowfile through.
>  
> The processor will roll back the session saying `hello` is not defined



--
This message was sent by Atlassian Jira
(v8.20.10#820010)