EXPAND ALL
- Home
- About Pixie
- Installing Pixie
- Using Pixie
- Tutorials
- Reference
Shorthand for exposing metadata columns in the DataFrame. Each metadata type can be converted from some sets of other metadata types that already exist in the DataFrame. Attempting to convert to a metadata type that doesn't have the source column will raise a compiler error. Available keys (and any aliases) as well as the source columns.
Name | Type | Description |
---|---|---|
metadata | string | The metadata property you wish to access. Function will throw an error if it doesn't exist. |
px.Column
: Column that represents the metadata in the DataFrame. Can be used in a DataFrame expression.
df = px.DataFrame('http_events', start_time='-5m')# Filter only for data that matches the metadata service.# df.ctx['service'] pulls the service column into the DataFrame.df = df[df.ctx['service'] == "pl/vizier-metadata"]
df = px.DataFrame('http_events', start_time='-5m')# Add the service column from the metadata object.df.service = df.ctx['service']# Group by the service.df = df.groupby('service').agg(req_count=('service', px.count))
# Where metadata context can fail.df = px.DataFrame('http_events', start_time='-5m')# Dropping upid so we remove the "source" column we could usedf = df.drop('upid')# FAILS: no source column available for the metadata conversion.df.service = df.ctx['service']