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

Method test_simple_varied

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

Source from the content-addressed store, hash-verified

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