bytewax._encoder#

Serialization of the dataflow data model.

Classes#

class RenderedPort#
port_name: str#
port_id: str#
from_port_ids: List[str]#
from_stream_ids: List[str]#
class RenderedOperator#
op_type: str#
step_name: str#
step_id: str#
inp_ports: List[RenderedPort]#
out_ports: List[RenderedPort]#
substeps: List[RenderedOperator]#
class RenderedDataflow#
flow_id: str#
substeps: List[RenderedOperator]#

Functions#

to_rendered(
flow: Dataflow,
) RenderedDataflow#

Convert a dataflow into the “rendered” data model.

This resolves all port links for you. All you have to do is set up the links by connecting RenderedPort.port_id to all RenderedPort.from_port_ids.

Args: flow: Dataflow.

Returns: Rendered dataflow.

json_for(obj) Any#

Hook to extend the JSON serialization.

Register new types via @json_for.register. See singledispatch for more info.

If this contains nested un-serializeable types, this will be re-called with them later by json.dumps; you don’t have to recurse yourself.

Args: obj: Un-handled type to attempt to encode.

Returns: A new value that is JSON serializable.

to_json(flow: Dataflow) str#

Encode this dataflow into JSON.

Args: flow: Dataflow.

Returns: JSON string.

to_plantuml(flow: Dataflow, recursive: bool = False) str#

Return a PlantUML diagram of part of a Dataflow.

Args: flow: Dataflow.

recursive: Wheither to show sub-steps.

Returns: PlantUML diagram string.

Join our community Slack channel

Need some help? Join our community!

If you have any trouble with the process or have ideas about how to improve this document, come talk to us in the #questions-answered Slack channel!

Join now