IBMStreams / streamsx.documentation

Streams documentation project for writing development guides and documentation

Home Page:http://ibmstreams.github.io/streamsx.documentation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Data sink sample doesn't run /docs/python/1.6/python-appapi-devguide-4/

natashadsilva opened this issue · comments

http://ibmstreams.github.io/streamsx.documentation/docs/python/1.6/python-appapi-devguide-4/
Under "Creating data sinks", I tried pasting the code as is and ran into these problems:

import sink_stderr_functions

There is no sink_stderr_functions module defined or mentioned anywhere.

After removing the import and running the sample, I get this error:

File "/tmp/1590155698285082925/output/toolkits/com.ibm.streamsx.topology/opt/python/packages/streamsx/topology/runtime.py", line 252, in iterableSource
return _IterablePickleOut(callable)
....
File "/tmp/1590155698285082925/output/toolkits/com.ibm.streamsx.topology/opt/python/packages/streamsx/topology/runtime.py", line 53, in _get_callable
ci = dill.loads(base64.b64decode(f))
AttributeError: Can't get attribute 'src' on <module '__main__' (<_frozen_importlib_external.SourceFileLoader object at 0x7f0a61b9fac8>)>
15 Jun 2017 16:18:00.463 [417901] ERROR #splapplog,J[0],P[0],src,spl_pe
... ...
: An exception occurred during the processing of the processing element. The error is: Can't get attribute 'src' on <module '__main__' (<_frozen_importlib_external.SourceFileLoader object at 0x7f0a61b9fac8>)>.
15 Jun 2017 16:18:00.474 [417901] ERROR #splapptrc,J[0],P[0],src,spl_operator M[PEImpl.cpp:process:1367]  - CDISR5053E: Runtime failures occurred in the following operators: src.

This is apparently happening because the source and sink function need to be defined in a separate module.
I think I have seen that mentioned somewhere but can't find it in the documentation for the Stream.sink or Stream.source functions.
@wmarshall484

I removed the import and it ran ok for me.

Fixed the sample code