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

Function test_unpack_col_schema

python/pathway/tests/test_utils.py:83–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81
82
83def test_unpack_col_schema():
84 class TestSchema(pw.Schema):
85 coord1: int
86 coord2: float
87 coord3: str
88
89 data = T(
90 """
91 | a | b | c
92 1 | 11 | 1.1 | abc
93 2 | 12 | 1.2 | def
94 3 | 13 | 1.3 | ghi
95 """
96 )
97 data = data.select(combined=pw.make_tuple(pw.this.a, pw.this.b, pw.this.c))
98 result = unpack_col(data.combined, schema=TestSchema)
99 assert_table_equality(
100 result,
101 T(
102 """
103 | coord1 | coord2 | coord3
104 1 | 11 | 1.1 | abc
105 2 | 12 | 1.2 | def
106 3 | 13 | 1.3 | ghi
107 """
108 ),
109 )
110
111
112def test_apply_all_rows():

Callers

nothing calls this directly

Calls 3

TFunction · 0.90
unpack_colFunction · 0.90
selectMethod · 0.45

Tested by

no test coverage detected