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

Method _with_schema

python/pathway/internals/table.py:2214–2228  ·  view source on GitHub ↗

Returns updated table with a forced schema on it.

(self, schema: type[Schema])

Source from the content-addressed store, hash-verified

2212 @contextualized_operator
2213 @check_arg_types
2214 def _with_schema(self, schema: type[Schema]) -> Table:
2215 """Returns updated table with a forced schema on it."""
2216 if schema.keys() != self.schema.keys():
2217 raise ValueError(
2218 "Table.with_schema() argument has to have the same column names as in the table."
2219 )
2220 context = clmn.SetSchemaContext(
2221 _id_column=self._id_column,
2222 _new_properties={
2223 self[name]._to_internal(): schema.column_properties(name)
2224 for name in self.column_names()
2225 },
2226 _id_column_props=schema.__universe_properties__,
2227 )
2228 return self._table_with_context(context)
2229
2230 @trace_user_frame
2231 @check_arg_types

Callers 3

update_typesMethod · 0.95
update_id_typeMethod · 0.95
await_futuresMethod · 0.80

Calls 5

column_namesMethod · 0.95
_table_with_contextMethod · 0.95
keysMethod · 0.45
_to_internalMethod · 0.45
column_propertiesMethod · 0.45

Tested by

no test coverage detected