morpheus.controllers.serialize_controller.SerializeController#

class SerializeController(include, exclude, fixed_columns)[source]#

Bases: object

Controller class for converting data to JSON lines format with customizable column selection and exclusion.

Parameters:
includetyping.List[str]

List of columns to include.

excludetyping.List[str]

List of columns to exclude.

fixed_columnsbool

Flag to indicate whether columns should be fixed.

Attributes:
exclude_columns

Get the list of excluded columns.

fixed_columns

Get the flag indicating whether columns are fixed.

include_columns

Get the list of included columns.

Methods

convert_to_df(msg, include_columns, ...)

Converts dataframe to entries to JSON lines.

get_exclude_col_pattern()

Get the list of compiled patterns for exclude columns.

get_include_col_pattern()

Get the compiled pattern for include columns.

convert_to_df(
msg,
include_columns,
exclude_columns,
)[source]#

Converts dataframe to entries to JSON lines.

Parameters:
msg :`morpheus.messages.ControlMessage`

ControlMessage instance that contains data.

include_columnstyping.Pattern

Columns that are required send to downstream stage.

exclude_columnstyping.List[typing.Pattern]

Columns that are not required send to downstream stage.

property exclude_columns#

Get the list of excluded columns.

property fixed_columns#

Get the flag indicating whether columns are fixed.

get_exclude_col_pattern()[source]#

Get the list of compiled patterns for exclude columns.

Returns:
typing.List[typing.Pattern]

The list of compiled patterns for exclude columns.

get_include_col_pattern()[source]#

Get the compiled pattern for include columns.

Returns:
typing.Pattern

The compiled pattern for include columns.

property include_columns#

Get the list of included columns.