Skip to content

Commit f750807

Browse files
committed
Adjust the demo to version 24.2.1
1 parent 9ccf2ec commit f750807

File tree

5 files changed

+16
-39
lines changed

5 files changed

+16
-39
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 1. Getting Started
44

5-
This guide demonstrates how to use the Java Apache Arrow implementation library (JArrow) with GraalPy, achieving zero-copy memory when transferring data between Java and Python.
5+
This guide demonstrates how to use the Java Apache Arrow implementation library (JArrow) with GraalPy, achieving zero-copy memory when transferring data between Java and Python native extensions, such as Pandas.
66

77
## 2. What you will need
88
* Basic knowledge of JArrow
@@ -90,8 +90,8 @@ There is also another option `arrow-memory-netty`. You can read more about Apach
9090
<execution>
9191
<configuration>
9292
<packages> <!---->
93-
<package>pandas</package> <!---->
94-
<package>pyarrow</package> <!---->
93+
<package>pandas==2.2.3</package> <!---->
94+
<package>pyarrow==19.0.0</package> <!---->
9595
</packages>
9696
</configuration>
9797
<goals>
@@ -107,7 +107,7 @@ or
107107
`build.gradle`
108108
```
109109
plugins {
110-
id 'org.graalvm.python' version '24.2.0'
110+
id 'org.graalvm.python' version '24.2.1'
111111
// ...
112112
```
113113

@@ -116,8 +116,8 @@ plugins {
116116
graalPy {
117117
community = true
118118
packages = [ // ①
119-
'pandas', // ②
120-
'pyarrow' // ③
119+
'pandas==2.2.3', // ②
120+
'pyarrow==19.0.0' // ③
121121
]
122122
}
123123
```
@@ -138,7 +138,6 @@ public static Context initContext() throws IOException {
138138
var fs = VirtualFileSystem.create();
139139
GraalPyResources.extractVirtualFileSystemResources(fs, resourcesDir); //
140140
return GraalPyResources.contextBuilder(resourcesDir)
141-
.option("python.PythonHome", "")
142141
.option("python.WarnExperimentalFeatures", "false")
143142
.allowHostAccess(HostAccess.ALL)
144143
.allowHostClassLookup(_ -> true)
@@ -147,9 +146,9 @@ public static Context initContext() throws IOException {
147146
}
148147
```
149148

150-
❶ Specify directory where resources will be copied.
149+
❶ Specify directory where python resources will be copied.
151150

152-
❷ Copy the resources from Virtual File System to the directory specified. This step is needed because PyArrow ...?
151+
❷ Copy the resources from Virtual File System (from the jar) to the directory specified in previous step. We are using real file system since
153152

154153
❸ Create the context with the given configuration.
155154

graalpy/graalpy-apache-arrow-guide/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'org.graalvm.python' version '24.2.0'
2+
id 'org.graalvm.python' version '24.2.1'
33
// ...
44
id 'application'
55
id 'java'
@@ -12,8 +12,8 @@ description = 'graalpy-apache-arrow-guide'
1212
graalPy {
1313
community = true
1414
packages = [ //
15-
'pandas', //
16-
'pyarrow' //
15+
'pandas==2.2.3', //
16+
'pyarrow==19.0.0' //
1717
]
1818
}
1919

graalpy/graalpy-apache-arrow-guide/gradle/libs.versions.toml

Lines changed: 0 additions & 14 deletions
This file was deleted.

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
<maven.compiler.target>23</maven.compiler.target>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<arrow.version>17.0.0</arrow.version>
16-
<!--Python version needs to be changed when we publish public artefacts-->
17-
<!-- <python.version>25.0.0-SNAPSHOT</python.version>-->
18-
<python.version>26.0.0</python.version>
16+
<python.version>24.2.1</python.version>
1917
</properties>
2018

2119

@@ -56,8 +54,8 @@
5654
<execution>
5755
<configuration>
5856
<packages> <!---->
59-
<package>pandas</package> <!---->
60-
<package>pyarrow</package> <!---->
57+
<package>pandas==2.2.3</package> <!---->
58+
<package>pyarrow==19.0.0</package> <!---->
6159
</packages>
6260
</configuration>
6361
<goals>

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@
22

33
import java.io.IOException;
44
import java.nio.file.Path;
5-
import java.time.Duration;
6-
import java.util.Map;
7-
import java.util.concurrent.ExecutorService;
8-
import java.util.concurrent.Executors;
9-
105
import org.apache.arrow.memory.BufferAllocator;
116
import org.apache.arrow.memory.RootAllocator;
127
import org.apache.arrow.vector.Float8Vector;
138
import org.graalvm.polyglot.Context;
149
import org.graalvm.polyglot.HostAccess;
1510
import org.graalvm.polyglot.Value;
16-
import org.graalvm.python.embedding.utils.GraalPyResources;
17-
import org.graalvm.python.embedding.utils.VirtualFileSystem;
11+
import org.graalvm.python.embedding.GraalPyResources;
12+
import org.graalvm.python.embedding.VirtualFileSystem;
1813

1914
public class Main {
2015

@@ -25,7 +20,6 @@ public static Context initContext() throws IOException {
2520
var fs = VirtualFileSystem.create();
2621
GraalPyResources.extractVirtualFileSystemResources(fs, resourcesDir); // ②
2722
return GraalPyResources.contextBuilder(resourcesDir)
28-
.option("python.PythonHome", "")
2923
.option("python.WarnExperimentalFeatures", "false")
3024
.allowHostAccess(HostAccess.ALL)
3125
.allowHostClassLookup(_ -> true)

0 commit comments

Comments
 (0)