Skip to content

Commit 03e5fe5

Browse files
authored
Fix docs: we're not installing stable version of spark anymore (#2165)
1 parent f74a764 commit 03e5fe5

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

docs/using/specifics.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ You can build a `pyspark-notebook` image with a different `Spark` version by ove
4949
- This version needs to match the version supported by the Spark distribution used above.
5050
- See [Spark Overview](https://spark.apache.org/docs/latest/#downloading) and [Ubuntu packages](https://packages.ubuntu.com/search?keywords=openjdk).
5151
- `spark_version` (optional): The Spark version to install, for example `3.5.0`.
52-
If not specified (this is the default), latest stable Spark will be installed.
52+
If not specified (this is the default), latest Spark will be installed.
53+
Note: to support Python 3.12, we currently install Spark v4 preview versions: <https://github.com/jupyter/docker-stacks/pull/2072#issuecomment-2414123851>.
5354
- `hadoop_version`: The Hadoop version (`3` by default).
5455
Note, that _Spark < 3.3_ require to specify `major.minor` Hadoop version (i.e. `3.2`).
5556
- `scala_version` (optional): The Scala version, for example `2.13` (not specified by default).

images/pyspark-notebook/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN apt-get update --yes && \
2424
ca-certificates-java && \
2525
apt-get clean && rm -rf /var/lib/apt/lists/*
2626

27-
# If spark_version is not set, latest stable Spark will be installed
27+
# If spark_version is not set, latest Spark will be installed
2828
ARG spark_version
2929
ARG hadoop_version="3"
3030
# If scala_version is not set, Spark without Scala will be installed

images/pyspark-notebook/setup_spark.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ def get_all_refs(url: str) -> list[str]:
2929

3030
def get_latest_spark_version() -> str:
3131
"""
32-
Returns the last stable version of Spark using spark archive
32+
Returns the last version of Spark using spark archive
3333
"""
3434
LOGGER.info("Downloading Spark versions information")
3535
all_refs = get_all_refs("https://archive.apache.org/dist/spark/")
36-
stable_versions = [
36+
versions = [
3737
ref.removeprefix("spark-").removesuffix("/")
3838
for ref in all_refs
3939
if ref.startswith("spark-") and "incubating" not in ref
@@ -49,7 +49,7 @@ def version_array(ver: str) -> tuple[int, int, int, str]:
4949
patch, _, preview = arr[2].partition("-")
5050
return (major, minor, int(patch), preview)
5151

52-
latest_version = max(stable_versions, key=lambda ver: version_array(ver))
52+
latest_version = max(versions, key=lambda ver: version_array(ver))
5353
LOGGER.info(f"Latest version: {latest_version}")
5454
return latest_version
5555

0 commit comments

Comments
 (0)