Skip to content

Commit 341af83

Browse files
committed
Removing is_vector_on_class_path helper method
1 parent b1d3e9b commit 341af83

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/GraalPythonModuleBuiltins.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,13 +1321,4 @@ static PTuple doExport(Object vector,
13211321
return createArrowCapsuleNode.execute(inliningTarget, arrowArray, arrowSchema);
13221322
}
13231323
}
1324-
1325-
@Builtin(name = "is_arrow_vector_on_class_path", minNumOfPositionalArgs = 0)
1326-
@GenerateNodeFactory
1327-
public abstract static class IsArrowVectorLoaded extends PythonBuiltinNode {
1328-
@Specialization
1329-
static boolean doSearch(@Bind("this") Node inliningTarget) {
1330-
return getContext(inliningTarget).arrowVectorSupport.isJavaArrowImplOnClassPath;
1331-
}
1332-
}
13331324
}

graalpython/lib-graalpython/modules/interop/arrow.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,13 @@
4040
import polyglot
4141
import java
4242

43-
if not __graalpython__.is_arrow_vector_on_class_path():
44-
raise KeyError("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.")
45-
elif not __graalpython__.host_import_enabled:
43+
44+
try:
45+
java.type("org.apache.arrow.vector.BaseFixedWidthVector")
46+
except KeyError:
47+
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.")
48+
49+
if not __graalpython__.host_import_enabled:
4650
raise NotImplementedError("Host lookup is not allowed. You can allow it while building python context.")
4751
else:
4852
class TinyIntVector:

0 commit comments

Comments
 (0)