Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tensorflow_io/core/kernels/arrow/arrow_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,11 @@ class ArrowMakeArrayDataImpl : public arrow::TypeVisitor {

// Make array data for the child type
type_ = type.value_type();
type.value_type()->Accept(this);
arrow::Status child_status = type.value_type()->Accept(this);
if (!child_status.ok()) {
return arrow::Status::NotImplemented(
"Unsupported list child type " + type.value_type()->ToString());
}
auto child_data = *out_data_;

// Make array data for the list TODO null count == 0
Expand Down
8 changes: 8 additions & 0 deletions tests/test_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ def test_arrow_io_tensor_lists(self):
iot = tfio.IOTensor.from_arrow(table)
self.run_test_case(iot, truth_data, table.column_names)

def test_arrow_io_tensor_list_string(self):
"""A list of strings is not buildable yet and must fail cleanly"""
table = pa.Table.from_arrays(
[pa.array([["a", "b"], ["c"]], type=pa.list_(pa.string()))], names=["a"]
)
with self.assertRaisesRegex(tf.errors.OpError, "Unsupported list child type"):
tfio.IOTensor.from_arrow(table)

def test_arrow_io_tensor_mixed(self):
"""test_arrow_io_tensor_mixed"""
truth_data = TruthData(
Expand Down
Loading