Skip to content

Commit

Permalink
Failing test stubs, raise on null array
Browse files Browse the repository at this point in the history
  • Loading branch information
wesm committed Mar 7, 2016
1 parent edb451c commit b5b5b82
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
10 changes: 8 additions & 2 deletions python/arrow/array.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,15 @@ cdef dict _array_classes = {
}

cdef object box_arrow_array(const shared_ptr[CArray]& sp_array):
cdef LogicalType type = sp_array.get().type().get().type
if sp_array.get() == NULL:
raise ValueError('Array was NULL')

cdef Array arr = _array_classes[type]()
cdef CDataType* data_type = sp_array.get().type().get()

if data_type == NULL:
raise ValueError('Array data type was NULL')

cdef Array arr = _array_classes[data_type.type]()
arr.init(sp_array)
return arr

Expand Down
16 changes: 15 additions & 1 deletion python/arrow/tests/test_convert_builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,19 @@

class TestConvertList(unittest.TestCase):

def test_list_convert(self):
def test_boolean(self):
pass

def test_integer(self):
arr = arrow.from_list([1, 2, 3])
assert len(arr) == 3
assert arr.type == arrow.int64()

def test_double(self):
pass

def test_string(self):
pass

def test_list_of_int(self):
pass

0 comments on commit b5b5b82

Please sign in to comment.