NVIDIA Morpheus (24.06)

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

List of columns to include.

exclude

List of columns to exclude.

fixed_columns

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(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

MultiMessage or ControlMessage instance that contains data.

include_columns

Columns that are required send to downstream stage.

exclude_columns

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.

Previous morpheus.controllers.serialize_controller
Next morpheus.controllers.write_to_file_controller
© Copyright 2024, NVIDIA. Last updated on Jul 8, 2024.