Skip to content

Commit 4ed22aa

Browse files
committed
Adjusting Main based on the README
1 parent dfaa139 commit 4ed22aa

File tree

3 files changed

+46
-50
lines changed

3 files changed

+46
-50
lines changed

graalpy/graalpy-apache-arrow-guide/README.md

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ Add the required dependencies for GraalPy and JArrow in the dependency section o
2121
### 3.1 GraalPy dependencies
2222
`pom.xml`
2323
```xml
24-
<dependency>
25-
<groupId>org.graalvm.python</groupId>
26-
<artifactId>python-community</artifactId> <!---->
27-
<version>${python.version}</version>
28-
<type>pom</type> <!---->
29-
</dependency>
30-
<dependency>
31-
<groupId>org.graalvm.python</groupId>
32-
<artifactId>python-embedding</artifactId> <!---->
33-
<version>${python.version}</version>
34-
</dependency>
24+
<dependency>
25+
<groupId>org.graalvm.python</groupId>
26+
<artifactId>python-community</artifactId> <!---->
27+
<version>${python.version}</version>
28+
<type>pom</type> <!---->
29+
</dependency>
30+
<dependency>
31+
<groupId>org.graalvm.python</groupId>
32+
<artifactId>python-embedding</artifactId> <!---->
33+
<version>${python.version}</version>
34+
</dependency>
3535
```
3636

3737
or
@@ -82,28 +82,24 @@ There is also another option `arrow-memory-netty`. You can read more about Apach
8282

8383
`pom.xml`
8484
```xml
85-
<build>
86-
<plugins>
87-
<plugin>
88-
<groupId>org.graalvm.python</groupId>
89-
<artifactId>graalpy-maven-plugin</artifactId>
90-
<version>${python.version}</version>
91-
<executions>
92-
<execution>
93-
<configuration>
94-
<packages> <!---->
95-
<package>pandas</package> <!---->
96-
<package>pyarrow</package> <!---->
97-
</packages>
98-
</configuration>
99-
<goals>
100-
<goal>process-graalpy-resources</goal>
101-
</goals>
102-
</execution>
103-
</executions>
104-
</plugin>
105-
</plugins>
106-
</build>
85+
<plugin>
86+
<groupId>org.graalvm.python</groupId>
87+
<artifactId>graalpy-maven-plugin</artifactId>
88+
<version>${python.version}</version>
89+
<executions>
90+
<execution>
91+
<configuration>
92+
<packages> <!---->
93+
<package>pandas</package> <!---->
94+
<package>pyarrow</package> <!---->
95+
</packages>
96+
</configuration>
97+
<goals>
98+
<goal>process-graalpy-resources</goal>
99+
</goals>
100+
</execution>
101+
</executions>
102+
</plugin>
107103
```
108104

109105
or

graalpy/graalpy-apache-arrow-guide/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,33 @@
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<arrow.version>17.0.0</arrow.version>
1616
<!--Python version needs to be changed when we publish public artefacts-->
17-
<!-- <python.version>25.0.0-SNAPSHOT</python.version>-->
17+
<!-- <python.version>25.0.0-SNAPSHOT</python.version>-->
1818
<python.version>26.0.0</python.version>
1919
</properties>
2020

2121

2222
<dependencies>
2323
<dependency>
2424
<groupId>org.apache.arrow</groupId>
25-
<artifactId>arrow-vector</artifactId>
25+
<artifactId>arrow-vector</artifactId> <!---->
2626
<version>${arrow.version}</version>
2727
</dependency>
2828
<dependency>
2929
<groupId>org.apache.arrow</groupId>
30-
<artifactId>arrow-memory-unsafe</artifactId>
30+
<artifactId>arrow-memory-unsafe</artifactId> <!---->
3131
<version>${arrow.version}</version>
3232
</dependency>
3333

3434
<!--GraalPy-->
3535
<dependency>
3636
<groupId>org.graalvm.python</groupId>
37-
<artifactId>python-community</artifactId>
37+
<artifactId>python-community</artifactId> <!---->
3838
<version>${python.version}</version>
39-
<type>pom</type>
39+
<type>pom</type> <!---->
4040
</dependency>
4141
<dependency>
4242
<groupId>org.graalvm.python</groupId>
43-
<artifactId>python-embedding</artifactId>
43+
<artifactId>python-embedding</artifactId> <!---->
4444
<version>${python.version}</version>
4545
</dependency>
4646
</dependencies>

graalpy/graalpy-apache-arrow-guide/src/main/java/com/example/Main.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@
1919
public class Main {
2020

2121
private static DataAnalysisPyModule dataAnalysisPyModule;
22-
private static final String PYTHON_URL = "https://www.graalvm.org/compatibility/module_results/python-module-testing-v241.csv";
23-
private static final String JAVASCRIPT_URL = "https://www.graalvm.org/compatibility/module_results/js-module-testing.csv";
24-
private static final Integer PASSING_RATE_COLUMN_INDEX = 3;
2522

2623
public static Context initContext() throws IOException {
27-
var resourcesDir = Path.of(System.getProperty("user.home"), ".cache", "graalpy-apache-arrow-guide.resources");
24+
var resourcesDir = Path.of(System.getProperty("user.home"), ".cache", "graalpy-apache-arrow-guide.resources"); // ①
2825
var fs = VirtualFileSystem.create();
29-
GraalPyResources.extractVirtualFileSystemResources(fs, resourcesDir);
26+
GraalPyResources.extractVirtualFileSystemResources(fs, resourcesDir); // ②
3027
return GraalPyResources.contextBuilder(resourcesDir)
31-
.option("python.PythonHome", "")
32-
.option("python.WarnExperimentalFeatures", "false")
33-
.allowHostAccess(HostAccess.ALL)
34-
.allowHostClassLookup(_ -> true)
35-
.allowNativeAccess(true)
36-
.build();
28+
.option("python.PythonHome", "")
29+
.option("python.WarnExperimentalFeatures", "false")
30+
.allowHostAccess(HostAccess.ALL)
31+
.allowHostClassLookup(_ -> true)
32+
.allowNativeAccess(true)
33+
.build(); // ③
3734
}
3835

3936
public static void initDataAnalysisPyModule(Context context) {
4037
Value value = context.eval("python", "import data_analysis; data_analysis");
4138
dataAnalysisPyModule = value.as(DataAnalysisPyModule.class);
4239
}
4340

41+
private static final String PYTHON_URL = "https://www.graalvm.org/compatibility/module_results/python-module-testing-v241.csv";
42+
private static final String JAVASCRIPT_URL = "https://www.graalvm.org/compatibility/module_results/js-module-testing.csv";
43+
private static final Integer PASSING_RATE_COLUMN_INDEX = 3;
4444

4545

4646
public static void main(String[] args) throws IOException, InterruptedException {

0 commit comments

Comments
 (0)