Skip to content

Commit 7fc630e

Browse files
committed
Update tests
1 parent 82f1314 commit 7fc630e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

bindings/python/test/test_arrow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ def test_auto_schema_first_list_null(self):
593593
]
594594
expected = pa.Table.from_pylist(
595595
[
596-
{"a": []},
596+
{"a": None},
597597
{"a": ["str"]},
598598
{"a": []},
599599
]
@@ -623,7 +623,7 @@ def test_auto_schema_first_list_element_null(self):
623623
]
624624
expected = pa.Table.from_pylist(
625625
[
626-
{"a": []},
626+
{"a": None},
627627
{"a": ["str"]}, # Inferred schema should use the first non-null element.
628628
{"a": []},
629629
]
@@ -638,7 +638,7 @@ def test_auto_schema_first_embedded_list_null(self):
638638
]
639639
expected = pa.Table.from_pylist(
640640
[
641-
{"a": {"b": []}},
641+
{"a": {"b": None}},
642642
{"a": {"b": ["str"]}},
643643
{"a": {"b": []}},
644644
]

bindings/python/test/test_builders.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def test_simple(self):
177177
builder.append_count()
178178
builder.append_null()
179179
arr = builder.finish()
180-
assert arr.to_pylist() == [0, 2, 2, 5, 5]
180+
assert arr.to_pylist() == [0, None, 2, None, 5]
181181

182182

183183
class TestBuilderManager(TestCase):
@@ -227,15 +227,15 @@ def test_nested_object(self):
227227
assert array_map["c.c"].to_pylist() == [None, None, None, None, 1.0]
228228
assert array_map["f"].to_pylist() == [None, None, None, None, None]
229229
# List with a null in the middle.
230-
assert array_map["c.d"].to_pylist() == [0, 1, 2, 3, 3, 4]
230+
assert array_map["c.d"].to_pylist() == [0, 1, 2, None, 3, 4]
231231
assert array_map["c.d[]"].to_pylist() == [1.4, 1.4, 1.4, 1.4]
232232
# Regular item with a null in the middle.
233233
assert array_map["c.b"].to_pylist() == ["1", "1", "1", None, "1"]
234234
# Nested object ids are object ids.
235235
obj = array_map["c.e"].to_pylist()[0]
236236
assert isinstance(obj, ObjectId)
237237
# Lists can contain objects.
238-
assert array_map["g[].a"].to_pylist() == [1, 1, 1, None, None]
238+
assert array_map["g[].a"].to_pylist() == [1, 1, 1]
239239

240240

241241
class TestBinaryBuilder(TestCase):

0 commit comments

Comments
 (0)