Skip to content

Commit b3a19f3

Browse files
author
yuzelin
committed
fix tests
1 parent 31abdd2 commit b3a19f3

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

.github/workflows/paimon-python-checks.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ jobs:
4343
with:
4444
java-version: ${{ env.JDK_VERSION }}
4545
distribution: 'adopt'
46+
- name: Set up hadoop dependency
47+
run: |
48+
mkdir -p ${{ github.workspace }}/temp
49+
curl -L -o ${{ github.workspace }}/temp/bundled-hadoop.jar \
50+
https://repo.maven.apache.org/maven2/org/apache/flink/flink-shaded-hadoop-2-uber/2.8.3-10.0/flink-shaded-hadoop-2-uber-2.8.3-10.0.jar
4651
- name: Run lint-python.sh
52+
env:
53+
_PYPAIMON_HADOOP_CLASSPATH: ${{ github.workspace }}/temp/bundled-hadoop.jar
4754
run: |
4855
chmod +x dev/lint-python.sh
4956
./dev/lint-python.sh

paimon_python_java/gateway_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def _get_hadoop_classpath(env):
103103
return env[constants.PYPAIMON_HADOOP_CLASSPATH]
104104

105105
if 'HADOOP_CLASSPATH' in env:
106-
return None
106+
return env['HADOOP_CLASSPATH']
107107
else:
108108
raise EnvironmentError(f"You haven't set '{constants.PYPAIMON_HADOOP_CLASSPATH}', \
109109
and 'HADOOP_CLASSPATH' is also not set. Ensure one of them is set.")

paimon_python_java/tests/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323

2424

2525
def setup_hadoop_bundle_jar(hadoop_dir):
26+
if constants.PYPAIMON_HADOOP_CLASSPATH in os.environ:
27+
file = os.environ[constants.PYPAIMON_HADOOP_CLASSPATH]
28+
if os.path.isfile(file):
29+
return
30+
2631
url = 'https://repo.maven.apache.org/maven2/org/apache/flink/' \
2732
'flink-shaded-hadoop-2-uber/2.8.3-10.0/flink-shaded-hadoop-2-uber-2.8.3-10.0.jar'
2833

0 commit comments

Comments
 (0)