Schema

pydantic model felis.datamodel.Schema

Database schema model.

This is the root object of the Felis data model.

Parameters:

data (Any)

Fields:
Validators:
field id_map: dict[str, Any] [Optional]

Map of IDs to objects.

Validated by:
field tables: Sequence[Table] [Required]

The tables in the schema.

Validated by:
field version: SchemaVersion | str | None = None

The version of the schema.

Validated by:
validator check_tap_table_indexes  »  all fields

Check that the TAP table indexes are unique.

Parameters:

info (ValidationInfo) – The validation context used to determine if the check is enabled.

Returns:

The schema being validated.

Return type:

Schema

validator check_unique_table_names  »  tables

Check that table names are unique.

Parameters:

tables (list[Table]) – The tables to check.

Returns:

The tables if they are unique.

Return type:

list [ Table ]

Raises:

ValueError – If table names are not unique.

model_post_init(ctx)

Post-initialization hook for the model.

Parameters:

ctx (Any) – The context object which was passed to the model.

Return type:

None

Notes

This method is called automatically by Pydantic after the model is initialized. It is used to create the ID map for the schema.

The ctx argument has the type Any because this is the function signature in Pydantic itself.