django-daiquiri / daiquiri

A framework for the publication of scientific databases
https://escience.aip.de/daiquiri
Apache License 2.0
26 stars 8 forks source link

BUG: Constant columns fail over tap #40

Closed olebole closed 7 months ago

olebole commented 5 years ago

When I do a query that includes a constant column, the answer fails:

>>> import pyvo
>>> s = pyvo.dal.TAPService('https://www.plate-archive.org/tap')
>>> s.run_sync("SELECT TOP 5 plate_id, 'col2' from applause_dr3.process;")
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pyvo/dal/query.py", line 248, in execute_votable
    return votableparse(self.execute_stream().read)
  File "/usr/lib/python3/dist-packages/astropy/io/votable/table.py", line 137, in parse
    config=config, pos=(1, 1)).parse(iterator, config)
  File "/usr/lib/python3/dist-packages/astropy/io/votable/tree.py", line 3390, in parse
    iterator, tag, data, config, pos)
  File "/usr/lib/python3/dist-packages/astropy/io/votable/tree.py", line 3319, in _add_resource
    resource.parse(self, iterator, config)
  File "/usr/lib/python3/dist-packages/astropy/io/votable/tree.py", line 3141, in parse
    iterator, tag, data, config, pos)
  File "/usr/lib/python3/dist-packages/astropy/io/votable/tree.py", line 3092, in _add_table
    table.parse(iterator, config)
  File "/usr/lib/python3/dist-packages/astropy/io/votable/tree.py", line 2382, in parse
    iterator, colnumbers, fields, config)
  File "/usr/lib/python3/dist-packages/astropy/io/votable/tree.py", line 2467, in _parse_tabledata
    vo_raise(E20, len(fields), config, pos)
  File "/usr/lib/python3/dist-packages/astropy/io/votable/exceptions.py", line 98, in vo_raise
    raise exception_class(args, config, pos)
astropy.io.votable.exceptions.E20: None:18:28: E20: Data has more columns than are defined in the header (1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/pyvo/dal/tap.py", line 194, in run_sync
    **keywords).execute()
  File "/usr/lib/python3/dist-packages/pyvo/dal/tap.py", line 810, in execute
    return TAPResults(self.execute_votable(), url=self.queryurl)
  File "/usr/lib/python3/dist-packages/pyvo/dal/query.py", line 251, in execute_votable
    raise DALFormatError(e, self.queryurl)
pyvo.dal.exceptions.DALFormatError: E20: None:18:28: E20: Data has more columns than are defined in the header (1)
kimakan commented 7 months ago

This doesn't seem to be an issue anymore. It was probably fixed with #207. Please open a new issue if there are still cases where this problem occurs.