Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
benpankow committed Jun 6, 2024
1 parent bfe3c4b commit 95650f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/content/concepts/metadata-tags/asset-metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Dagster supports attaching a few different types of definition metadata:

- [**Arbitrary metadata**](#arbitrary-metadata-using-the-metadata-parameter), such as the storage location of the table produced by the asset
- [**Asset owners**](#asset-owners), which are the people and/or teams who own the asset
- [**Column-level lineage**](#column-level-lineage), which is information about how a column is created and used
- [**Table and column metadata**](#table-and-column-metadata), which provides additional context about a tabular asset, such as its schema or row count

### Arbitrary metadata using the metadata parameter

Expand Down Expand Up @@ -129,7 +129,7 @@ def topstories(context: AssetExecutionContext) -> MaterializeResult:
)
```

### Column-level lineage
### Table and column metadata

For assets which produce database tables, you can attach table metadata to provide additional context about the asset. Table metadata can include information such as the schema, row count, or column lineage. Refer to the [Table metadata documentation](/concepts/metadata-tags/asset-metadata/table-metadata) for more information, or the [Column-level lineage documentation](/concepts/metadata-tags/asset-metadata/column-level-lineage) for specific details on column-level lineage.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ Dagster supports attaching different types of table metadata to assets, includin

### For assets defined in Dagster

Column schema metadata can be attached to Dagster assets either as [definition metadata](/concepts/metadata-tags/asset-metadata#attaching-definition-metadata) or [materialization metadata](/concepts/metadata-tags/asset-metadata#attaching-materialization-metadata), which will then be visible in the Dagster UI. For example:

<Image
alt="Column schema for an asset in the Dagster UI"
src="/images/concepts/metadata-tags/metadata-table-schema.png"
width={1793}
height={652}
/>

You may attach column schema metadata to Dagster assets either as [definition metadata](/concepts/metadata-tags/asset-metadata#attaching-definition-metadata) or [materialization metadata](/concepts/metadata-tags/asset-metadata#attaching-materialization-metadata). If the schema of your asset is pre-defined, you can attach it as definition metadata. If the schema is only known when an asset is materialized, you can attach it as metadata to the materialization.
If the schema of your asset is pre-defined, you can attach it as definition metadata. If the schema is only known when an asset is materialized, you can attach it as metadata to the materialization.

To attach schema metadata to an asset, you will need to:

Expand Down Expand Up @@ -90,14 +92,16 @@ Dagster's dbt integration enables automatically attaching column schema metadata

## Attaching row count

Row count metadata can be attached to Dagster assets as [materialization metadata](/concepts/metadata-tags/asset-metadata#attaching-materialization-metadata) to provide additional context about the number of rows in a materialized table. This will be highlighted in the Dagster UI. For example:

<Image
alt="Row count for an asset in the Dagster UI"
src="/images/concepts/metadata-tags/metadata-row-count.png"
width={1921}
height={559}
/>

You may attach row count metadata to Dagster assets as [materialization metadata](/concepts/metadata-tags/asset-metadata#attaching-materialization-metadata) to provide additional context about the number of rows in a materialized table. Dagster will let you track changes in the row count over time, and you can use this information to monitor data quality.
In addition to showing the latest row count, Dagster will let you track changes in the row count over time, and you can use this information to monitor data quality.

To attach row count metadata to an asset, you will need to attach a numerical value to the `dagster/row_count` key in the metadata parameter of the <PyObject object="MaterializeResult" /> object returned by the asset function. For example:

Expand Down

0 comments on commit 95650f3

Please sign in to comment.