Skip to content

Commit 68ba349

Browse files
committed
BUG:fixing asu-tsv return_type for vizier
1 parent 0cc58b7 commit 68ba349

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

astroquery/vizier/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -717,12 +717,12 @@ def parse_vizier_tsvfile(data, *, verbose=False):
717717
718718
Parameters
719719
----------
720-
data : ascii str
721-
An ascii string containing the vizier-formatted list of tables
720+
data : response content bytes
721+
Bytes containing the vizier-formatted list of tables
722722
"""
723723

724724
# http://stackoverflow.com/questions/4664850/find-all-occurrences-of-a-substring-in-python
725-
split_indices = [m.start() for m in re.finditer('\n\n#', data)]
725+
split_indices = [m.start() for m in re.finditer(b'\n\n#', data)]
726726
# we want to slice out chunks of the file each time
727727
split_limits = zip(split_indices[:-1], split_indices[1:])
728728
tables = [ascii.read(BytesIO(data[a:b]), format='fast_tab', delimiter='\t',

astroquery/vizier/tests/test_vizier_remote.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,10 @@ def test_findcatalog_ucd(self):
133133
assert len(result) >= 628
134134
# important part: we're testing that UCD is parsed and some catalogs are ruled out
135135
assert len(ucdresult) < len(result)
136+
137+
def test_asu_tsv_return_type(self):
138+
V = vizier.core.Vizier()
139+
result = V.query_object("HD 226868", catalog=["NOMAD", "UCAC"], return_type='asu-tsv', cache=False)
140+
141+
assert isinstance(result, list)
142+
assert len(result) == 3

0 commit comments

Comments
 (0)