Skip to content

Commit 3880664

Browse files
committed
Only consider r'^spark-\d' as possible spark version
1 parent bd63eaa commit 3880664

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

images/pyspark-notebook/setup_spark.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import argparse
1010
import logging
1111
import os
12+
import re
1213
import subprocess
1314
from pathlib import Path
1415

@@ -33,11 +34,13 @@ def get_latest_spark_version() -> str:
3334
"""
3435
LOGGER.info("Downloading Spark versions information")
3536
all_refs = get_all_refs("https://archive.apache.org/dist/spark/")
37+
LOGGER.info(f"All refs: {all_refs}")
3638
versions = [
3739
ref.removeprefix("spark-").removesuffix("/")
3840
for ref in all_refs
39-
if ref.startswith("spark-") and "incubating" not in ref
41+
if re.match(r"^spark-\d", ref) is not None and "incubating" not in ref
4042
]
43+
LOGGER.info(f"Available versions: {versions}")
4144

4245
# Compare versions semantically
4346
def version_array(ver: str) -> tuple[int, int, int, str]:

0 commit comments

Comments
 (0)