MCPcopy
hub / github.com/pathwaycom/pathway / with_types

Method with_types

python/pathway/internals/schema.py:386–397  ·  view source on GitHub ↗
(self, **kwargs)

Source from the content-addressed store, hash-verified

384 return self.__columns__.keys()
385
386 def with_types(self, **kwargs) -> type[Schema]:
387 columns: dict[str, ColumnDefinition] = {
388 col.name: col.to_definition() for col in self.__columns__.values()
389 }
390 for name, dtype in kwargs.items():
391 if name not in columns:
392 raise ValueError(
393 f"Schema.with_types() argument name has to be an existing column name, received f{name}."
394 )
395 columns[name] = dataclasses.replace(columns[name], dtype=dt.wrap(dtype))
396
397 return schema_builder(columns=columns, id_dtype=self.id.dtype)
398
399 def without(self, *args: str | expr.ColumnReference) -> type[Schema]:
400 columns: dict[str, ColumnDefinition] = {

Callers 5

update_typesMethod · 0.80
await_futuresMethod · 0.80
__init_subclass__Method · 0.80
replay_csvFunction · 0.80
replay_csv_with_timeFunction · 0.80

Calls 6

to_definitionMethod · 0.80
valuesMethod · 0.80
itemsMethod · 0.80
replaceMethod · 0.80
wrapMethod · 0.80
schema_builderFunction · 0.70

Tested by

no test coverage detected