Skip to content

Commit 7cbe6d1

Browse files
committed
Introduce register_interop_behavior method
1 parent 879c840 commit 7cbe6d1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

graalpython/lib-graalpython/modules/_polyglot_arrow.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
try:
4444
java.type("org.apache.arrow.vector.BaseFixedWidthVector")
4545
except KeyError:
46-
raise ImportError("It is not possible to import Apache Arrow Vector classes because arrow-vector package is not on the class path. Please add this library to your project.")
46+
raise ImportError(
47+
"It is not possible to import Apache Arrow Vector classes because arrow-vector package is not on the class path. Please add this library to your project.")
4748

4849
if not __graalpython__.host_import_enabled:
4950
raise NotImplementedError("Host lookup is not allowed. You can allow it while building python context.")
@@ -120,6 +121,7 @@ def __arrow_c_array__(self, requested_schema=None):
120121
return __graalpython__.export_arrow_vector(self)
121122

122123

124+
def register_interop_behavior():
123125
# Ints
124126
int8_vector_class_path = java.type("org.apache.arrow.vector.TinyIntVector")
125127
int16_vector_class_path = java.type("org.apache.arrow.vector.SmallIntVector")
@@ -141,4 +143,4 @@ def __arrow_c_array__(self, requested_schema=None):
141143

142144
polyglot.register_interop_type(float2_vector_class_path, Float2Vector)
143145
polyglot.register_interop_type(float4_vector_class_path, Float4Vector)
144-
polyglot.register_interop_type(float8_vector_class_path, Float8Vector)
146+
polyglot.register_interop_type(float8_vector_class_path, Float8Vector)

0 commit comments

Comments
 (0)