MCPcopy Create free account
hub / github.com/apache/arrow / test_simple_varied

Method test_simple_varied

python/pyarrow/tests/test_csv.py:1017–1031  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1015 }
1016
1017 def test_simple_varied(self):
1018 # Infer various kinds of data
1019 rows = b"a,b,c,d\n1,2,3,0\n4.0,-5,foo,True\n"
1020 table = self.read_bytes(rows)
1021 schema = pa.schema([('a', pa.float64()),
1022 ('b', pa.int64()),
1023 ('c', pa.string()),
1024 ('d', pa.bool_())])
1025 assert table.schema == schema
1026 assert table.to_pydict() == {
1027 'a': [1.0, 4.0],
1028 'b': [2, -5],
1029 'c': ["3", "foo"],
1030 'd': [False, True],
1031 }
1032
1033 def test_simple_nulls(self):
1034 # Infer various kinds of data, with nulls

Callers

nothing calls this directly

Calls 3

read_bytesMethod · 0.95
schemaMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected