Skip to content

Commit 89b8176

Browse files
author
kx79wq
committed
fix: allow for spark4 with scala 2.13
1 parent c3a7d01 commit 89b8176

4 files changed

Lines changed: 13 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pandas = [
4040
"pandas"
4141
]
4242
spark = [
43-
"pyspark<4; python_version <= '3.11'",
43+
"pyspark; python_version <= '3.11'",
4444
]
4545
test = [
4646
"ipykernel>=5.1.3",
34.1 KB
Binary file not shown.
771 KB
Binary file not shown.

tests/test_spark_histogrammar.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,18 @@ def get_spark():
2121

2222
current_path = Path(__file__).resolve().parent
2323

24-
scala = "2.12" if int(pyspark_version[0]) >= 3 else "2.11"
25-
hist_spark_jar = current_path / f"jars/histogrammar-sparksql_{scala}-1.0.20.jar"
26-
hist_jar = current_path / f"jars/histogrammar_{scala}-1.0.20.jar"
24+
if int(pyspark_version[0]) == 2:
25+
scala = "2.11"
26+
hg_version = "1.0.20"
27+
elif int(pyspark_version[0]) == 3:
28+
scala = "2.12"
29+
hg_version = "1.0.20"
30+
else: # spark 4+
31+
scala = "2.13"
32+
hg_version = "1.0.30"
33+
34+
hist_spark_jar = current_path / f"jars/histogrammar-sparksql_{scala}-{hg_version}.jar"
35+
hist_jar = current_path / f"jars/histogrammar_{scala}-{hg_version}.jar"
2736

2837
return (
2938
SparkSession.builder.master("local")

0 commit comments

Comments
 (0)