Skip to content

Commit 411bcd2

Browse files
committed
[SPARK-43580][PYTHON][TESTS] Add https://dlcdn.apache.org/` to default_sites of get_preferred_mirrors
### What changes were proposed in this pull request? This PR aims to add `https://dlcdn.apache.org/` to the default mirror site list during python installation tests. ### Why are the changes needed? This is a preferred mirror. So, even if `https://www.apache.org/dyn/closer.lua` is inaccessible, we will download from `https://dlcdn.apache.org/`. ``` $ curl https://www.apache.org/dyn/closer.lua\?preferred\=true https://dlcdn.apache.org/ ``` Although we try to get this programmatically, sometimes `https://www.apache.org/dyn/closer.lua` seems to fail. https://github.com/apache/spark/blob/acad77d56112f2cab2ce5adca913b75ce659add5/python/pyspark/install.py#L169C2-L179 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. Closes #41222 from dongjoon-hyun/SPARK-43580. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent acad77d commit 411bcd2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/pyspark/install.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,11 @@ def get_preferred_mirrors():
179179
pass
180180

181181
default_sites = [
182+
"https://dlcdn.apache.org/",
182183
"https://archive.apache.org/dist",
183184
"https://dist.apache.org/repos/dist/release",
184185
]
185-
return list(set(mirror_urls)) + default_sites
186+
return list(set(mirror_urls)) + [x for x in default_sites if x not in mirror_urls]
186187

187188

188189
def download_to_file(response, path, chunk_size=1024 * 1024):

0 commit comments

Comments
 (0)