morpheus.messages.message_meta.AppShieldMessageMeta

(Latest Version)
class AppShieldMessageMeta(df, source)[source]

Bases: morpheus.messages.message_meta.MessageMeta

This class extends MessageMeta to also hold source corresponding to batched metadata.

Parameters
dfpd.DataFrame

Input rows in dataframe.

sourcestr

Determines which source generated the snapshot messages.

Attributes
count

Returns the number of messages in the batch.

df

Methods

ensure_sliceable_index()

Replaces the index in the underlying dataframe if the existing one is not unique and monotonic.

get_meta_range(mess_offset, message_count[, ...])

Return column values from morpheus.pipeline.messages.MessageMeta.df from the specified start offset until the message count.

has_sliceable_index()

Returns True if the underlying DataFrame's index is unique and monotonic.

copy_dataframe

mutable_dataframe

property count: int

Returns the number of messages in the batch.

Returns
int

number of messages in the MessageMeta.df.

ensure_sliceable_index()[source]

Replaces the index in the underlying dataframe if the existing one is not unique and monotonic. The old index will be preserved in a column named _index_{old_index.name}. If has_sliceable_index() == true, this is a no-op.

Returns
str

The name of the column with the old index or None if no changes were made

get_meta_range(mess_offset, message_count, columns=None)[source]

Return column values from morpheus.pipeline.messages.MessageMeta.df from the specified start offset until the message count.

Parameters
mess_offsetint

Offset into the metadata batch.

mess_countint

Messages count.

columnstyping.Union[None, str, typing.List[str]]

Input column names. Returns all columns if None is specified. When a string is passed, a Series is returned. Otherwise a Dataframe is returned.

Returns
Series or Dataframe

Column values from the dataframe.

has_sliceable_index()[source]

Returns True if the underlying DataFrame’s index is unique and monotonic. Sliceable indices have better performance since a range of rows can be specified by a start and stop index instead of requiring boolean masks.

Returns
bool

© Copyright 2023, NVIDIA. Last updated on Apr 11, 2023.