IBMStreams / streamsx.topology

Develop streaming applications for IBM Streams in Python, Java & Scala.
http://ibmstreams.github.io/streamsx.topology
Apache License 2.0
29 stars 43 forks source link

Documentation: Syntax error in Stream.split() example #2607

Closed markheger closed 4 years ago

markheger commented 4 years ago

https://streamsxtopology.readthedocs.io/en/v1.17.1/streamsx.topology.topology.html#streamsx.topology.topology.Stream.split

See msgs and msg:

msgs = topo.source(ReadMessages())
SEVS = {'H':0, 'M':1, 'L':2}
severities = msg.split(3, lambda SEVS.get(msg.get('SEV'), -1),
    names=['high','medium','low'], name='SeveritySplit')

high_severity = severities.high
high_severity.for_each(SendAlert())

medium_severity = severities.medium
medium_severity.for_each(LogMessage())

low_severity = severities.low
low_severity.for_each(Archive())