morpheus.messages.message_meta.AppShieldMessageMeta
- 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
- sourcestr
Input rows in dataframe.
Determines which source generated the snapshot messages.
- Attributes
count
- df
Returns the number of messages in the batch.
Methods
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.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}
. Ifhas_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
- mess_countint
- columnstyping.Union[None, str, typing.List[str]]
Offset into the metadata batch.
Messages count.
Input column names. Returns all columns if
None
is specified. When a string is passed, aSeries
is returned. Otherwise aDataframe
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