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

Function _create_input_table

python/pathway/stdlib/utils/pandas_transformer.py:19–38  ·  view source on GitHub ↗
(*input: pw.Table)

Source from the content-addressed store, hash-verified

17
18
19def _create_input_table(*input: pw.Table):
20 def as_tuple(*args):
21 return args
22
23 result = []
24 for idx, table in enumerate(input):
25 tupled_cols = table.select(
26 all_cols=pw.apply(as_tuple, table.id, *_table_columns(table))
27 )
28 reduced = tupled_cols.reduce(
29 **{f"_{idx}": pw.reducers.sorted_tuple(tupled_cols.all_cols)}
30 )
31 result.append(reduced)
32
33 def _add_tables(first: pw.Table, *tables: pw.Table) -> pw.Table:
34 for table in tables:
35 first += table.with_universe_of(first)
36 return first
37
38 return _add_tables(*result)
39
40
41def _argument_index(func_spec: FunctionSpec, arg: str | int | None) -> int | None:

Callers 1

_pandas_transformerFunction · 0.85

Calls 5

_table_columnsFunction · 0.85
_add_tablesFunction · 0.85
applyMethod · 0.80
selectMethod · 0.45
reduceMethod · 0.45

Tested by

no test coverage detected