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
- include
- exclude
- fixed_columns
List of columns to include.
List of columns to exclude.
Flag to indicate whether columns should be fixed.
- Attributes
exclude_columns
fixed_columns
include_columns
Get the list of excluded columns.
Get the flag indicating whether columns are fixed.
Get the list of included columns.
Methods
convert_to_df
(x, 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(x, include_columns, exclude_columns)[source]
Converts dataframe to entries to JSON lines.
- Parameters
-
x :
morpheus.pipeline.messages.MultiMessage
:morpheus.pipeline.messages.ControlMessage
- include_columns
- exclude_columns
MultiMessage or ControlMessage instance that contains data.
Columns that are required send to downstream stage.
Columns that are not required send to downstream stage.
-
x :
- 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.