MCPcopy Create free account
hub / github.com/apache/arrow / test_to_string

Function test_to_string

python/pyarrow/tests/test_gandiva.py:377–393  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

375
376@pytest.mark.gandiva
377def test_to_string():
378 import pyarrow.gandiva as gandiva
379 builder = gandiva.TreeExprBuilder()
380
381 assert str(builder.make_literal(2.0, pa.float64())
382 ).startswith('(const double) 2 raw(')
383 assert str(builder.make_literal(2, pa.int64())) == '(const int64) 2'
384 assert str(builder.make_field(pa.field('x', pa.float64()))) == '(double) x'
385 assert str(builder.make_field(pa.field('y', pa.string()))) == '(string) y'
386
387 field_z = builder.make_field(pa.field('z', pa.bool_()))
388 func_node = builder.make_function('not', [field_z], pa.bool_())
389 assert str(func_node) == 'bool not((bool) z)'
390
391 field_y = builder.make_field(pa.field('y', pa.bool_()))
392 and_node = builder.make_and([func_node, field_y])
393 assert str(and_node) == 'bool not((bool) z) && (bool) y'
394
395
396@pytest.mark.gandiva

Callers

nothing calls this directly

Calls 2

fieldMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected