[
https://issues.apache.org/jira/browse/NIFI-10287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17603149#comment-17603149
]
Nissim Shiman commented on NIFI-10287:
--------------------------------------
[~dstiegli1] Thank you so much for donating this unit test! The code will get
squashed for the final commit, so your authorship may be "lost" in github, but
I definitely appreciate it and at least those reading this jira page will know
who wrote it :)
It is a nice broad unit test which covers more paths than the one mentioned
above, so that is an added plus as well!
Regarding your first point, when writing the jira ticket, I try to make the
simplest use case to demonstrate an issue for an end user who wishes to
duplicate it.
When doing unit tests I try to model them to be similar to existing unit tests
in the surrounding code so the code keeps a homogenous look.
I think I met these goals with this ticket, but it is true that test case in
the ticket above and github unit test are not the same.
> 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: 2h
> 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)