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

Function schema

python/pyarrow/jvm.py:259–280  ·  view source on GitHub ↗

Construct a Schema from a org.apache.arrow.vector.types.pojo.Schema instance. Parameters ---------- jvm_schema: org.apache.arrow.vector.types.pojo.Schema Returns ------- pyarrow.Schema

(jvm_schema)

Source from the content-addressed store, hash-verified

257
258
259def schema(jvm_schema):
260 """
261 Construct a Schema from a org.apache.arrow.vector.types.pojo.Schema
262 instance.
263
264 Parameters
265 ----------
266 jvm_schema: org.apache.arrow.vector.types.pojo.Schema
267
268 Returns
269 -------
270 pyarrow.Schema
271 """
272 fields = jvm_schema.getFields()
273 fields = [field(f) for f in fields]
274 jvm_metadata = jvm_schema.getCustomMetadata()
275 if jvm_metadata.isEmpty():
276 metadata = None
277 else:
278 metadata = {str(entry.getKey()): str(entry.getValue())
279 for entry in jvm_metadata.entrySet()}
280 return pa.schema(fields, metadata)
281
282
283def array(jvm_array):

Callers 4

record_batchFunction · 0.70
makeMethod · 0.50
Schema__from_fieldsFunction · 0.50
Schema__from_listFunction · 0.50

Calls 2

fieldFunction · 0.70
schemaMethod · 0.45

Tested by

no test coverage detected