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

Function test_orcfile_empty

python/pyarrow/tests/test_orc.py:205–235  ·  view source on GitHub ↗
(datadir)

Source from the content-addressed store, hash-verified

203
204
205def test_orcfile_empty(datadir):
206 from pyarrow import orc
207
208 table = orc.ORCFile(datadir / "TestOrcFile.emptyFile.orc").read()
209 assert table.num_rows == 0
210
211 expected_schema = pa.schema([
212 ("boolean1", pa.bool_()),
213 ("byte1", pa.int8()),
214 ("short1", pa.int16()),
215 ("int1", pa.int32()),
216 ("long1", pa.int64()),
217 ("float1", pa.float32()),
218 ("double1", pa.float64()),
219 ("bytes1", pa.binary()),
220 ("string1", pa.string()),
221 ("middle", pa.struct(
222 [("list", pa.list_(
223 pa.struct([("int1", pa.int32()),
224 ("string1", pa.string())])))
225 ])),
226 ("list", pa.list_(
227 pa.struct([("int1", pa.int32()),
228 ("string1", pa.string())])
229 )),
230 ("map", pa.map_(pa.string(),
231 pa.struct([("int1", pa.int32()),
232 ("string1", pa.string())])
233 )),
234 ])
235 assert table.schema == expected_schema
236
237
238def test_filesystem_uri(tmpdir):

Callers

nothing calls this directly

Calls 3

readMethod · 0.45
schemaMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected