Esempio n. 1
0
    def test_pyarrow(self):
        import pyarrow as pa
        from perspective._type import type_detect
        x1 = pa.Array(['test', 'test2'])
        x2 = pa.frombuffer(b'test')

        type_detect(x1)
        type_detect(x2)

        import sys
        sys.modules['pyarrow'] = Nope()
        type_detect('test')
        sys.modules['pyarrow'] = pa
Esempio n. 2
0
def test_constructor_raises():
    # This could happen by wrong capitalization.
    # ARROW-2638: prevent calling extension class constructors directly
    with pytest.raises(TypeError):
        pa.Array([1, 2])
Esempio n. 3
0
def test_repr_on_pre_init_array():
    arr = pa.Array()
    assert len(repr(arr)) > 0
Esempio n. 4
0
def test_constructor_raises():
    # This could happen by wrong capitalization.
    with pytest.raises(RuntimeError):
        pa.Array([1, 2])