Skip to content

Commit 58f8692

Browse files
committed
MAINT: adding deprecation for the removed argument
1 parent e24b67c commit 58f8692

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

astroquery/gaia/core.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from astropy.io import votable
2828
from astropy.table import Table
2929
from astropy.units import Quantity
30+
from astropy.utils.decorators import deprecated_renamed_argument
3031
from requests import HTTPError
3132

3233
from astroquery import log
@@ -167,9 +168,11 @@ def logout(self, *, verbose=False):
167168
except HTTPError:
168169
log.error("Error logging out data server")
169170

171+
@deprecated_renamed_argument("output_file", None, since="0.4.8")
170172
def load_data(self, ids, *, data_release=None, data_structure='INDIVIDUAL', retrieval_type="ALL",
171173
linking_parameter='SOURCE_ID', valid_data=False, band=None, avoid_datatype_check=False,
172-
format="votable", dump_to_file=False, overwrite_output_file=False, verbose=False):
174+
format="votable", dump_to_file=False, overwrite_output_file=False, verbose=False,
175+
output_file=None):
173176
"""Loads the specified table
174177
TAP+ only
175178

astroquery/gaia/tests/test_gaiatap.py

+13-8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from astropy.coordinates.sky_coordinate import SkyCoord
2727
from astropy.table import Column, Table
2828
from astropy.utils.data import get_pkg_data_filename
29+
from astropy.utils.exceptions import AstropyDeprecationWarning
2930
from requests import HTTPError
3031

3132
from astroquery.gaia import conf
@@ -1022,14 +1023,18 @@ def load_data_monkeypatched(self, params_dict, output_file, verbose):
10221023

10231024
monkeypatch.setattr(TapPlus, "load_data", load_data_monkeypatched)
10241025

1025-
GAIA_QUERIER.load_data(
1026-
valid_data=True,
1027-
ids="1,2,3,4",
1028-
format='votable',
1029-
retrieval_type="epoch_photometry",
1030-
verbose=True,
1031-
dump_to_file=True,
1032-
overwrite_output_file=True)
1026+
# Keep the tests, just remove the argument once the deprecation is removed
1027+
with pytest.warns(AstropyDeprecationWarning,
1028+
match='"output_file" was deprecated in version 0.4.8'):
1029+
GAIA_QUERIER.load_data(
1030+
valid_data=True,
1031+
ids="1,2,3,4",
1032+
format='votable',
1033+
retrieval_type="epoch_photometry",
1034+
verbose=True,
1035+
dump_to_file=True,
1036+
overwrite_output_file=True,
1037+
output_file=tmp_path / "output_file")
10331038

10341039
path.unlink()
10351040

0 commit comments

Comments
 (0)