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

Method test_simple_varied

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

Source from the content-addressed store, hash-verified

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