I see. Thank you Matt. -Jim
On Mon, Feb 12, 2018 at 12:10 PM, Matt Burgess <mattyb...@apache.org> wrote:
> In this case I don't think it's as much that the modules aren't being
> found, rather that the datetime module in Jython returns
> java.sql.Timestamp (Java) objects, rather than Jython/Python datetime
> objects, and the former do not support the methods/attributes of the
> latter, including timetuple(). Apparently  this change was made
> around Jython 2.5, and NiFi uses 2.7.1.
> Looks like you'll need to write your own timetuple() function, using
> the java.sql.Timestamp  and related APIs.
>  http://www.jython.org/javadoc/com/ziclix/python/sql/
>  https://docs.oracle.com/javase/8/docs/api/java/sql/Timestamp.html
> On Mon, Feb 12, 2018 at 11:58 AM, James McMahon <jsmcmah...@gmail.com>
> > Good afternoon. I havd a python script that I can execute from the
> > line via my python interpreter. In it, I do this
> > myTime = time.mktime(myDateTime.timetuple())
> > When I try to run from my ExecuteScript processor in NiFi, this is not
> > recognized. This error gets thrown:
> > 'java.sql.Timestamp' object has no attribute 'timetuple' in <script>
> > Why would the available python modules not be found in the ExecuteScript
> > are found outside NiFi?
> > Thanks very much. -Jim