I see. Thank you Matt. -Jim

On Mon, Feb 12, 2018 at 12:10 PM, Matt Burgess <mattyb...@apache.org> wrote:

> Jim,
>
> 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 [1] 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 [2] and related APIs.
>
> Regards,
> Matt
>
> [1] http://www.jython.org/javadoc/com/ziclix/python/sql/
> Jython22DataHandler.html
> [2] 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>
> wrote:
> > Good afternoon. I havd a python script that I can execute from the
> command
> > 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
> yet
> > are found outside NiFi?
> >
> > Thanks very much. -Jim
>

Reply via email to