Skip to content

Commit cd91eae

Browse files
committed
Deprecate get_raw_response
1 parent f1c2791 commit cd91eae

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

astroquery/mpc/core.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from . import conf
1818
from ..utils import async_to_sync, class_or_instance
1919
from ..exceptions import InvalidQueryError, EmptyResponseError
20+
from astropy.utils.decorators import deprecated_renamed_argument
2021

2122
__all__ = ['MPCClass']
2223

@@ -763,6 +764,8 @@ def _args_to_ephemeris_payload(self, **kwargs):
763764
return request_args
764765

765766
@class_or_instance
767+
@deprecated_renamed_argument("get_raw_response", None, since="0.4.9",
768+
alternative="async methods")
766769
def get_observations_async(self, targetid, *,
767770
id_type=None,
768771
get_mpcformat=False,
@@ -774,6 +777,11 @@ def get_observations_async(self, targetid, *,
774777
from the `Minor Planet Center observations database
775778
<https://minorplanetcenter.net/db_search>`_.
776779
780+
.. deprecated:: 0.4.9
781+
The ``get_raw_response`` keyword argument is deprecated. The
782+
`~MPCClass.get_observationsephemerides_async` method will return a raw response.
783+
784+
777785
Parameters
778786
----------
779787
targetid : int or str

astroquery/mpc/tests/test_mpc.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,8 @@ def test_get_observations(patch_get):
415415
assert result['DEC'].unit == u.deg
416416
assert result['epoch'].unit == u.d
417417

418-
result = mpc.core.MPC.get_observations('12893',
419-
get_raw_response=True)
420-
421-
assert result[0]['designation'] == "1998 QS55"
418+
result = mpc.core.MPC.get_observations_async('12893')
419+
assert result.json()[0]['designation'] == "1998 QS55"
422420

423421
result = mpc.core.MPC.get_observations('12893',
424422
get_mpcformat=True)

0 commit comments

Comments
 (0)