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

Method test_simple_varied

python/pyarrow/tests/test_json.py:195–210  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

193 }
194
195 def test_simple_varied(self):
196 # Infer various kinds of data
197 rows = (b'{"a": 1,"b": 2, "c": "3", "d": false}\n'
198 b'{"a": 4.0, "b": -5, "c": "foo", "d": true}\n')
199 table = self.read_bytes(rows)
200 schema = pa.schema([('a', pa.float64()),
201 ('b', pa.int64()),
202 ('c', pa.string()),
203 ('d', pa.bool_())])
204 assert table.schema == schema
205 assert table.to_pydict() == {
206 'a': [1.0, 4.0],
207 'b': [2, -5],
208 'c': ["3", "foo"],
209 'd': [False, True],
210 }
211
212 def test_simple_nulls(self):
213 # 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