kelp.models.metric_view¶
Reference for the metric_view configuration model.
kelp.models.metric_view.MetricView
pydantic-model
¶
Bases: BaseModel
Metric View definition for Databricks.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the metric view. |
catalog |
str | None
|
The catalog where the metric view will be created. |
schema_ |
str | None
|
The schema where the metric view will be created. |
description |
str | None
|
Optional description of the metric view. |
definition |
dict[str, Any]
|
The metric view definition as a dictionary. This should contain the full metric view specification including dimensions, metrics, and the underlying table. |
tags |
dict[str, str]
|
Optional tags for the metric view. |
origin_file_path |
SkipJsonSchema[str] | None
|
Path to the source YAML file (internal use). |
raw_config |
SkipJsonSchema[dict]
|
Preserve original, unparsed config (including placeholder vars). |
Show JSON schema:
{
"description": "Metric View definition for Databricks.\n\nAttributes:\n name: The name of the metric view.\n catalog: The catalog where the metric view will be created.\n schema_: The schema where the metric view will be created.\n description: Optional description of the metric view.\n definition: The metric view definition as a dictionary. This should contain\n the full metric view specification including dimensions, metrics,\n and the underlying table.\n tags: Optional tags for the metric view.\n origin_file_path: Path to the source YAML file (internal use).\n raw_config: Preserve original, unparsed config (including placeholder vars).",
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"catalog": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Catalog"
},
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Schema"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Description"
},
"definition": {
"additionalProperties": true,
"description": "The metric view definition including dimensions, metrics, and source table",
"title": "Definition",
"type": "object"
},
"tags": {
"additionalProperties": {
"type": "string"
},
"title": "Tags",
"type": "object"
},
"meta": {
"additionalProperties": true,
"description": "Generic user-defined metadata for filtering and grouping",
"title": "Meta",
"type": "object"
}
},
"required": [
"name"
],
"title": "MetricView",
"type": "object"
}
Config:
validate_by_name:Truevalidate_by_alias:Trueserialize_by_alias:True
Fields:
-
origin_file_path(SkipJsonSchema[str] | None) -
name(str) -
catalog(str | None) -
schema_(str | None) -
description(str | None) -
definition(dict[str, Any]) -
tags(dict[str, str]) -
meta(dict[str, Any]) -
raw_config(SkipJsonSchema[dict])
definition
pydantic-field
¶
The metric view definition including dimensions, metrics, and source table
model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
serialize_by_alias=True,
)
get_qualified_name
¶
Get the fully qualified metric view name including catalog/schema if applicable.