Skip to content

TableSchema

relationalai.semantics.frontend.base
TableSchema(table: Table, exclude: list[str] = [])

Represents a schema projection derived from a Table.

A TableSchema is typically created via Table.to_schema and then passed to Concept.new (to create one entity per source row) or to Model.select (to select all columns). Column names in exclude are matched case-insensitively.

  • table

    (Table) - Source table whose columns make up the schema.
  • exclude

    (list[str], default: []) - Column names to omit from the schema.

Most users should not instantiate this class directly. Prefer Table.to_schema.

TableSchema.exclude: set[str]

Set of excluded column names (stored in lowercase).

TableSchema.get_columns() -> list[Relationship]

Return the table columns included in this schema.

This filters the underlying Table columns using the exclude list passed to Table.to_schema (matched case-insensitively).

Returns:

  • list[Relationship] - Column relationships in the same order as the source table.
TableSchemaDSLBase
 semantics > frontend > base
└──  Table
    └──  to_schema