MCPcopy Index your code
hub / github.com/pathwaycom/pathway / schema_builder

Function schema_builder

python/pathway/internals/schema.py:830–855  ·  view source on GitHub ↗
(
    columns: dict[str, ColumnDefinition],
    *,
    name: str | None = None,
    properties: SchemaProperties = SchemaProperties(),
    id_dtype: dt.DType = dt.ANY_POINTER,
    id_append_only: bool | None = None,
)

Source from the content-addressed store, hash-verified

828
829
830def 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
858def schema_from_dict(

Callers 8

schema_from_columnsFunction · 0.70
schema_from_pandasFunction · 0.70
with_typesMethod · 0.70
withoutMethod · 0.70
with_id_typeMethod · 0.70
update_propertiesMethod · 0.70
schema_from_dictFunction · 0.70
schema_from_csvFunction · 0.70

Calls 4

SchemaPropertiesClass · 0.85
_schema_builderFunction · 0.85
itemsMethod · 0.80
keysMethod · 0.45

Tested by

no test coverage detected