| 395 | |
| 396 | @pytest.mark.gandiva |
| 397 | def test_rejects_none(): |
| 398 | import pyarrow.gandiva as gandiva |
| 399 | |
| 400 | builder = gandiva.TreeExprBuilder() |
| 401 | |
| 402 | field_x = pa.field('x', pa.int32()) |
| 403 | schema = pa.schema([field_x]) |
| 404 | literal_true = builder.make_literal(True, pa.bool_()) |
| 405 | |
| 406 | with pytest.raises(TypeError): |
| 407 | builder.make_field(None) |
| 408 | |
| 409 | with pytest.raises(TypeError): |
| 410 | builder.make_if(literal_true, None, None, None) |
| 411 | |
| 412 | with pytest.raises(TypeError): |
| 413 | builder.make_and([literal_true, None]) |
| 414 | |
| 415 | with pytest.raises(TypeError): |
| 416 | builder.make_or([None, literal_true]) |
| 417 | |
| 418 | with pytest.raises(TypeError): |
| 419 | builder.make_in_expression(None, [1, 2, 3], pa.int32()) |
| 420 | |
| 421 | with pytest.raises(TypeError): |
| 422 | builder.make_expression(None, field_x) |
| 423 | |
| 424 | with pytest.raises(TypeError): |
| 425 | builder.make_condition(None) |
| 426 | |
| 427 | with pytest.raises(TypeError): |
| 428 | builder.make_function('less_than', [literal_true, None], pa.bool_()) |
| 429 | |
| 430 | with pytest.raises(TypeError): |
| 431 | gandiva.make_projector(schema, [None]) |
| 432 | |
| 433 | with pytest.raises(TypeError): |
| 434 | gandiva.make_filter(schema, None) |