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

Function test_schema_from_tuples

python/pyarrow/tests/test_schema.py:344–361  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

342
343
344def test_schema_from_tuples():
345 fields = [
346 ('foo', pa.int32()),
347 ('bar', pa.string()),
348 ('baz', pa.list_(pa.int8())),
349 ]
350 sch = pa.schema(fields)
351 assert sch.names == ['foo', 'bar', 'baz']
352 assert sch.types == [pa.int32(), pa.string(), pa.list_(pa.int8())]
353 assert len(sch) == 3
354 assert repr(sch) == """\
355foo: int32
356bar: string
357baz: list<item: int8>
358 child 0, item: int8"""
359
360 with pytest.raises(TypeError):
361 pa.schema([('foo', None)])
362
363
364def test_schema_from_mapping():

Callers

nothing calls this directly

Calls 3

lenFunction · 0.85
stringMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected