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

Method test_simple_varied

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

Source from the content-addressed store, hash-verified

999 }
1000
1001 def test_simple_varied(self):
1002 # Infer various kinds of data
1003 rows = b"a,b,c,d\n1,2,3,0\n4.0,-5,foo,True\n"
1004 table = self.read_bytes(rows)
1005 schema = pa.schema([('a', pa.float64()),
1006 ('b', pa.int64()),
1007 ('c', pa.string()),
1008 ('d', pa.bool_())])
1009 assert table.schema == schema
1010 assert table.to_pydict() == {
1011 'a': [1.0, 4.0],
1012 'b': [2, -5],
1013 'c': ["3", "foo"],
1014 'd': [False, True],
1015 }
1016
1017 def test_simple_nulls(self):
1018 # 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