(
columns: dict[str, ColumnDefinition],
*,
name: str | None = None,
properties: SchemaProperties = SchemaProperties(),
id_dtype: dt.DType = dt.ANY_POINTER,
id_append_only: bool | None = None,
)
| 828 | |
| 829 | |
| 830 | def schema_builder( |
| 831 | columns: dict[str, ColumnDefinition], |
| 832 | *, |
| 833 | name: str | None = None, |
| 834 | properties: SchemaProperties = SchemaProperties(), |
| 835 | id_dtype: dt.DType = dt.ANY_POINTER, |
| 836 | id_append_only: bool | None = None, |
| 837 | ) -> type[Schema]: |
| 838 | if name is None: |
| 839 | name = "custom_schema(" + str(list(columns.keys())) + ")" |
| 840 | |
| 841 | __annotations = {name: c.dtype or Any for name, c in columns.items()} |
| 842 | |
| 843 | __dict: dict[str, Any] = { |
| 844 | "__metaclass__": SchemaMetaclass, |
| 845 | "__annotations__": __annotations, |
| 846 | **columns, |
| 847 | } |
| 848 | |
| 849 | return _schema_builder( |
| 850 | name, |
| 851 | __dict, |
| 852 | properties=properties, |
| 853 | id_dtype=id_dtype, |
| 854 | id_append_only=id_append_only, |
| 855 | ) |
| 856 | |
| 857 | |
| 858 | def schema_from_dict( |
no test coverage detected