From d946271c10bd4e74480962c74ae84ad6c0bc4a8c Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Fri, 12 Nov 2021 15:15:08 -0500 Subject: [PATCH 1/3] fix a deprecation issue --- astroquery/alma/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astroquery/alma/core.py b/astroquery/alma/core.py index 174f97b1bc..dfda7f3dfd 100644 --- a/astroquery/alma/core.py +++ b/astroquery/alma/core.py @@ -577,7 +577,7 @@ def get_data_info(self, uids, expand_tarfiles=False, if res.status[0] != 'OK': raise Exception('ERROR {}: {}'.format(res.status[0], res.status[1])) - temp = res.table + temp = res.to_table() if ASTROPY_LT_4_1: # very annoying for col in [x for x in temp.colnames From eed6d897850fd8bd6af3ffd1483a599adb3837f8 Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Fri, 12 Nov 2021 15:17:38 -0500 Subject: [PATCH 2/3] fix more of the same issue --- astroquery/alma/core.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/astroquery/alma/core.py b/astroquery/alma/core.py index dfda7f3dfd..e0a592354e 100644 --- a/astroquery/alma/core.py +++ b/astroquery/alma/core.py @@ -646,9 +646,11 @@ def is_proprietary(self, uid): query = "select distinct data_rights from ivoa.obscore where " \ "obs_id='{}'".format(uid) result = self.query_tap(query) - if not result or len(result.table) == 0: + if result: + tableresult = result.to_table() + if not result or len(tableresult) == 0: raise AttributeError('{} not found'.format(uid)) - if len(result.table) == 1 and result.table[0][0] == 'Public': + if len(tableresult) == 1 and tableresult[0][0] == 'Public': return False return True From ee6d53b9871f3794c32734c0cd331e19c7f3d11d Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Fri, 12 Nov 2021 16:42:15 -0500 Subject: [PATCH 3/3] fix tests --- astroquery/alma/tests/test_alma.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astroquery/alma/tests/test_alma.py b/astroquery/alma/tests/test_alma.py index 84ec00b7fe..dfa9580c15 100644 --- a/astroquery/alma/tests/test_alma.py +++ b/astroquery/alma/tests/test_alma.py @@ -381,7 +381,7 @@ def test_tap(): def test_get_data_info(): datalink_mock = Mock() dl_result = Table.read(data_path('alma-datalink.xml'), format='votable') - mock_response = Mock(table=dl_result) + mock_response = Mock(to_table=Mock(return_value=dl_result)) mock_response.status = ['OK'] datalink_mock.run_sync.return_value = mock_response alma = Alma()