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

Function _jvm_schema

python/pyarrow/tests/test_jvm.py:95–106  ·  view source on GitHub ↗
(jvm_spec, metadata=None)

Source from the content-addressed store, hash-verified

93
94
95def _jvm_schema(jvm_spec, metadata=None):
96 field = _jvm_field(jvm_spec)
97 schema_cls = jpype.JClass('org.apache.arrow.vector.types.pojo.Schema')
98 fields = jpype.JClass('java.util.ArrayList')()
99 fields.add(field)
100 if metadata:
101 dct = jpype.JClass('java.util.HashMap')()
102 for k, v in metadata.items():
103 dct.put(k, v)
104 return schema_cls(fields, dct)
105 else:
106 return schema_cls(fields)
107
108
109# In the following, we use the JSON serialization of the Field objects in Java.

Callers 1

test_jvm_typesFunction · 0.85

Calls 2

_jvm_fieldFunction · 0.85
putMethod · 0.80

Tested by

no test coverage detected