Astroquery: sha.query raises ValueError

Created on 9 Oct 2020  路  4Comments  路  Source: astropy/astroquery

Hi,

While using Astroquery, I came across the following error. Other coordinates that I have tried seems to work without any problem.

from astroquery import sha
sha.query(ra = 219.57741, dec = 64.171525, size = 0.001)

ValueError Traceback (most recent call last)
in
----> 1 sha.query(ra = 219.57741, dec = 64.171525, size = 0.001)

~/.local/lib/python3.8/site-packages/astroquery/sha/core.py in query(coord, ra, dec, size, naifid, pid, reqkey, dataset, verbosity, return_response, return_payload)
145 # To table
146 # transpose data for appropriate table instance handling
--> 147 t = Table(list(zip(*data)), names=col_names, dtype=dtypes)
148 return t
149

~/.local/lib/python3.8/site-packages/astropy/table/table.py in __init__(self, data, masked, names, dtype, meta, copy, rows, copy_indices, **kwargs)
605 names = [fix_column_name(name) for name in names]
606
--> 607 self._check_names_dtype(names, dtype, n_cols)
608
609 # Finally do the real initialization

~/.local/lib/python3.8/site-packages/astropy/table/table.py in _check_names_dtype(self, names, dtype, n_cols)
827
828 if len(names) != n_cols or len(dtype) != n_cols:
--> 829 raise ValueError(
830 'Arguments "names" and "dtype" must match number of columns'
831 .format(inp_str))

ValueError: Arguments "names" and "dtype" must match number of columns

bug package-novice sha

All 4 comments

Thanks for the report.

it seems we have an empty return table which has zero number of columns and the parser cannot yet handle that.

I'm leaving it as package-novice issue, with the clear task to add a check for empty return in the following file, around this location. Have a NoResultsWarning insteand and grafully return an empy table. Similar warning and empty table return was done in https://github.com/astropy/astroquery/pull/1829/ .

:

> /Users/bsipocz/munka/devel/astroquery/astroquery/sha/core.py(147)query()
    145     # To table
    146     # transpose data for appropriate table instance handling
--> 147     t = Table(list(zip(*data)), names=col_names, dtype=dtypes)
    148     return t
    149 

ipdb> len(col_names)                                                                                                    
42
ipdb> data                                                                                                              
[]

Hello @bsipocz . I am an outreachy applicant. Can I take this issue up?

Certainly, please go ahead.

Was this page helpful?
0 / 5 - 0 ratings