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

Method schema_arrow

python/pyarrow/parquet/core.py:392–415  ·  view source on GitHub ↗

Return the inferred Arrow schema, converted from the whole Parquet file's schema Examples -------- Generate an example Parquet file: >>> import pyarrow as pa >>> table = pa.table({'n_legs': [2, 2, 4, 4, 5, 100], ...

(self)

Source from the content-addressed store, hash-verified

390
391 @property
392 def schema_arrow(self):
393 """
394 Return the inferred Arrow schema, converted from the whole Parquet
395 file's schema
396
397 Examples
398 --------
399 Generate an example Parquet file:
400
401 >>> import pyarrow as pa
402 >>> table = pa.table({'n_legs': [2, 2, 4, 4, 5, 100],
403 ... 'animal': ["Flamingo", "Parrot", "Dog", "Horse",
404 ... "Brittle stars", "Centipede"]})
405 >>> import pyarrow.parquet as pq
406 >>> pq.write_table(table, 'example.parquet')
407 >>> parquet_file = pq.ParquetFile('example.parquet')
408
409 Read the Arrow schema:
410
411 >>> parquet_file.schema_arrow
412 n_legs: int64
413 animal: string
414 """
415 return self.reader.schema_arrow
416
417 @property
418 def num_row_groups(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected