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

Function test_simple_method

python/pathway/tests/test_transformers.py:288–324  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

286
287
288def test_simple_method():
289 @transformer
290 class foo_transformer:
291 class table(ClassArg):
292 a: int = input_attribute()
293
294 @output_attribute
295 def b(self) -> int:
296 return self.a * 10
297
298 @method
299 def c(self, arg) -> int:
300 return (self.a + self.b) * arg
301
302 table = T(
303 """
304 | a
305 1 | 1
306 2 | 2
307 3 | 3
308 """
309 )
310
311 method_table = foo_transformer(table).table
312 result = method_table.select(ret=method_table.c(10))
313
314 assert_table_equality(
315 result,
316 T(
317 """
318 | ret
319 1 | 110
320 2 | 220
321 3 | 330
322 """
323 ),
324 )
325
326
327def test_select_method_column():

Callers

nothing calls this directly

Calls 4

TFunction · 0.90
foo_transformerClass · 0.70
selectMethod · 0.45
cMethod · 0.45

Tested by

no test coverage detected