Skip to content

Commit 294640d

Browse files
committed
Apparently it is possible for MOUSes to have 'null' files
1 parent e3b69e7 commit 294640d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

astroquery/alma/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ def _json_summary_to_table(self, data, base_url):
895895
"""
896896
columns = {'uid': [], 'URL': [], 'size': []}
897897
for entry in data['node_data']:
898-
is_file = (entry['de_type'] == 'MOUS' or
898+
is_file = (entry['de_type'] == 'MOUS' and
899899
(entry['file_name'] != 'null' and
900900
entry['file_key'] != 'null'))
901901
if is_file:
@@ -922,6 +922,9 @@ def _json_summary_to_table(self, data, base_url):
922922
entry['file_key'],
923923
entry['file_name'],
924924
)
925+
if 'null' in url:
926+
raise ValueError("The URL {0} was created containing "
927+
"'null', which is invalid.".format(url))
925928
columns['URL'].append(url)
926929

927930
columns['size'] = u.Quantity(columns['size'], u.Gbyte)

0 commit comments

Comments
 (0)