wiring.get_table_schema()

Return the schema as the dg.TableSchema that Dagster’s Columns tab shows.

Usage

Source

wiring.get_table_schema(schema)

Each column has its dtype, description, nullability, uniqueness and column constraints. Its tags come from dy.Column(metadata=...), with each value converted to a string, except the dagster_dataframely key, whose severities the checks show. The primary key is a table constraint, so only unique=True marks a key column unique.

Parameters

schema: type[dy.Schema]
The schema to render.

Returns

dg.TableSchema
A table schema with the columns in the schema’s order.

Raises

ReservedColumnError

A column name is in the reserved dy_ namespace.

InvalidColumnNameError

A column name has a character Dagster does not allow in an asset check name.

CheckNameCollisionError

Two rules produce the same asset check name.

InvalidSeverityError
The schema declares a severity this package cannot read.

Examples

import dagster_dataframely as dd
from dagster_dataframely.data import OrdersSchema

dd.wiring.get_table_schema(OrdersSchema).columns[0]
TableColumn(name='order_id', type='String', description='Order identifier, unique together with `line_no`.', constraints=TableColumnConstraints(nullable=False, unique=False, other=['matches ^ORD-\\d{4}$']), tags={})