From 81337fcc67c2fd8eca7fd7c4bc2f05468febc929 Mon Sep 17 00:00:00 2001 From: Sam Bianco Date: Tue, 28 Oct 2025 16:10:54 -0400 Subject: [PATCH 1/2] Use continuation when downloading files --- astroquery/mast/collections.py | 2 +- astroquery/mast/observations.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/astroquery/mast/collections.py b/astroquery/mast/collections.py index ffab0d18f2..48d23fd95b 100644 --- a/astroquery/mast/collections.py +++ b/astroquery/mast/collections.py @@ -601,7 +601,7 @@ def download_hsc_spectra(self, spectra, *, download_dir=None, cache=True, curl_f bundler_response = response[0].json() local_path = os.path.join(download_dir, "{}.sh".format(download_file)) - self._download_file(bundler_response['url'], local_path, head_safe=True, continuation=False) + self._download_file(bundler_response['url'], local_path, head_safe=True) status = "COMPLETE" msg = None diff --git a/astroquery/mast/observations.py b/astroquery/mast/observations.py index 320af9ed78..a515960ff7 100644 --- a/astroquery/mast/observations.py +++ b/astroquery/mast/observations.py @@ -670,11 +670,11 @@ def download_file(self, uri, *, local_path=None, base_url=None, cache=True, clou else: log.warning("Falling back to mast download...") self._download_file(escaped_url, local_path, - cache=cache, head_safe=True, continuation=False, + cache=cache, head_safe=True, verbose=verbose) else: self._download_file(escaped_url, local_path, - cache=cache, head_safe=True, continuation=False, + cache=cache, head_safe=True, verbose=verbose) # check if file exists also this is where would perform md5, From e88d68685c46f31a4603ff7c03bf39652c05b0ee Mon Sep 17 00:00:00 2001 From: Sam Bianco Date: Tue, 28 Oct 2025 16:15:52 -0400 Subject: [PATCH 2/2] changelog --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 6b7a418315..9540003431 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -28,6 +28,8 @@ mast - Filtering by file extension or by a string column is now case-insensitive in ``MastMissions.filter_products`` and ``Observations.filter_products``. [#3427] +- Switch to use HTTP continuation for partial downloads. [#3448] + Infrastructure, Utility and Other Changes and Additions -------------------------------------------------------