Metadata Types
Metadata allows you to attach structured information to assets, ops, and events in Dagster. This information is displayed in the Dagster UI and can be used for debugging, monitoring, and documentation.MetadataValue
Base class for all metadata values. Provides static constructor methods for creating typed metadata values.Static Constructors
Creates a text metadata value.Parameters:
text(str): The text string for a metadata entry
TextMetadataValueCreates a URL metadata value that renders as a clickable link in the UI.Parameters:
url(str): The URL for a metadata entry
UrlMetadataValueCreates a filesystem path metadata value.Parameters:
path(str | PathLike): The path for a metadata entry
PathMetadataValueCreates a notebook path metadata value. The UI will render the notebook inline.Parameters:
path(str | PathLike): The path to a notebook
NotebookMetadataValueCreates a JSON metadata value. The UI will render the JSON in a structured format.Parameters:
data(Sequence[Any] | Mapping[str, Any]): JSON-serializable data
JsonMetadataValueCreates a Markdown metadata value. The UI will render the markdown.Parameters:
data(str): Markdown string
MarkdownMetadataValueCreates a reference to a Python artifact (class or function).Parameters:
python_artifact(Callable): The Python class or function
PythonArtifactMetadataValueCreates a float metadata value.Parameters:
value(float): The float value
FloatMetadataValueCreates an integer metadata value.Parameters:
value(int): The integer value
IntMetadataValueCreates a boolean metadata value.Parameters:
value(bool): The boolean value
BoolMetadataValueCreates a timestamp metadata value.Parameters:
value(float | datetime): Unix timestamp or datetime object (must have timezone)
TimestampMetadataValueCreates a reference to a Dagster run.Parameters:
run_id(str): The ID of the run
DagsterRunMetadataValueCreates a reference to a Dagster asset. The UI will render a link to the asset.Parameters:
asset_key(AssetKey): The asset key
DagsterAssetMetadataValueCreates a reference to a Dagster job.Parameters:
job_name(str): The name of the joblocation_name(str): The code location namerepository_name(str, optional): The repository name
DagsterJobMetadataValueCreates tabular metadata that renders as a table in the UI.Parameters:
records(Sequence[TableRecord]): List of table recordsschema(TableSchema, optional): Optional table schema
TableMetadataValueCreates table schema metadata.Parameters:
schema(TableSchema): The table schema
TableSchemaMetadataValueCreates column lineage metadata showing dependencies between columns.Parameters:
lineage(TableColumnLineage): The column lineage
TableColumnLineageMetadataValueCreates a null metadata value.Returns:
NullMetadataValueCreates a reference to a concurrency pool.Parameters:
pool(str): The pool identifier
PoolMetadataValueTable Metadata Types
TableRecord
Represents one record in a table. Used withMetadataValue.table().
Dictionary mapping column names to values. Values must be strings, integers, floats, bools, or None.
TableSchema
Representation of a schema for tabular data.List of column definitions.
Optional table-level constraints.
TableColumn
Descriptor for a table column.Column name.
Column type (e.g., “string”, “int”, “float”, “bool”, “timestamp”). Defaults to “string”.
Optional column description.
Column-level constraints.
Optional tags for filtering or organizing columns.
TableColumnConstraints
Constraints for a table column.Whether the column can hold null values. Defaults to True.
Whether all values in the column must be unique. Defaults to False.
List of arbitrary constraint descriptions (e.g., less than or equal to 100, starts with A).
TableConstraints
Table-level constraints.Descriptions of arbitrary table-level constraints (e.g., [“column_a > column_b”]).
TableColumnLineage
Represents column-level lineage for an asset.Mapping from output column names to the columns they depend on.
TableColumnDep
Identifier for a column in an asset.The asset key containing the column.
The name of the column.
Usage Examples
Asset Materialization with Metadata
Op with Metadata
Table Schema Metadata
Automatic Metadata Conversion
Dagster automatically converts simple Python types to metadata values:See Also
- Assets - Learn about defining assets
- Ops - Learn about ops and outputs
- Config Types - Learn about configuration types
- Partition Types - Learn about partition definitions
