Skip to content

Commit b31f9d9

Browse files
authored
Merge pull request #2207 from keflavich/alma_to_table_deprecation
ALMA: fix a deprecation issue
2 parents 0fb3a9b + ee6d53b commit b31f9d9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

astroquery/alma/core.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ def get_data_info(self, uids, expand_tarfiles=False,
577577
if res.status[0] != 'OK':
578578
raise Exception('ERROR {}: {}'.format(res.status[0],
579579
res.status[1]))
580-
temp = res.table
580+
temp = res.to_table()
581581
if ASTROPY_LT_4_1:
582582
# very annoying
583583
for col in [x for x in temp.colnames
@@ -646,9 +646,11 @@ def is_proprietary(self, uid):
646646
query = "select distinct data_rights from ivoa.obscore where " \
647647
"obs_id='{}'".format(uid)
648648
result = self.query_tap(query)
649-
if not result or len(result.table) == 0:
649+
if result:
650+
tableresult = result.to_table()
651+
if not result or len(tableresult) == 0:
650652
raise AttributeError('{} not found'.format(uid))
651-
if len(result.table) == 1 and result.table[0][0] == 'Public':
653+
if len(tableresult) == 1 and tableresult[0][0] == 'Public':
652654
return False
653655
return True
654656

astroquery/alma/tests/test_alma.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def test_tap():
381381
def test_get_data_info():
382382
datalink_mock = Mock()
383383
dl_result = Table.read(data_path('alma-datalink.xml'), format='votable')
384-
mock_response = Mock(table=dl_result)
384+
mock_response = Mock(to_table=Mock(return_value=dl_result))
385385
mock_response.status = ['OK']
386386
datalink_mock.run_sync.return_value = mock_response
387387
alma = Alma()

0 commit comments

Comments
 (0)