Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions astroquery/alma/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion astroquery/alma/tests/test_alma.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down