astropy / astropy/pyvo

pyvo queries failing with "file not VOTABLE" error

Open
#403 8 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
88
Forks
64
Avg merge
38m
Merged PRs (30d)
1

Description

Hello. The pyvo queries that JWQL performs have suddenly started crashing with an error that "File does not appear to be VOTABLE". Here is our query:
```
import pyvo as vo
instrument = 'nircam'
proposal = 1068
tap_service = vo.dal.TAPService("http://vao.stsci.edu/caomtap/tapservice.aspx")
tap_results = tap_service.search(f"select observationID from dbo.CaomObservation where collection='JWST' and maxLevel=2 and insName like '{instrument.lower()}' and prpID='{int(proposal)}'")
```

```
E19 Traceback (most recent call last)
~/miniconda3/envs/jwql-py3.8/lib/python3.8/site-packages/pyvo/dal/query.py in execute_votable(self, post)
241 try:
--> 242 return votableparse(self.execute_stream(post=post).read)
243 except Exception as e:

~/miniconda3/envs/jwql-py3.8/lib/python3.8/site-packages/astropy/utils/decorators.py in wrapper(*args, **kwargs)
545
--> 546 return function(*args, **kwargs)
547

~/miniconda3/envs/jwql-py3.8/lib/python3.8/site-packages/astropy/io/votable/table.py in parse(source, columns, invalid, verify, chunk_size, table_number, table_id, filename, unit_format, datatype_mapping, _debug_python_based_parser)
158 _debug_python_based_parser=_debug_python_based_parser) as iterator:
--> 159 return tree.VOTableFile(
160 config=config, pos=(1, 1)).parse(iterator, config)

~/miniconda3/envs/jwql-py3.8/lib/python3.8/site-packages/astropy/io/votable/tree.py in parse(self, iterator, config)
3599 else:
-> 3600 vo_raise(E19, (), config, pos)
3601 config.update(self._get_version_checks())

~/miniconda3/envs/jwql-py3.8/lib/python3.8/site-packages/astropy/io/votable/exceptions.py in vo_raise(exception_class, args, config, pos)
111 config = {}
--> 112 raise exception_class(args, config, pos)
113

E19: None:2:9: E19: File does not appear to be a VOTABLE

During handling of the above exception, another exception occurred:

DALFormatError Traceback (most recent call last)
in
----> 1 tap_results = tap_service.search(f"select observationID from dbo.CaomObservation where collection='JWST' and maxLevel=2 and insName like '{instrument.lower()}' and prpID='{int(proposal)}'")

~/miniconda3/envs/jwql-py3.8/lib/python3.8/site-packages/pyvo/dal/tap.py in run_sync(self, query, language, maxrec, uploads, **keywords)
244 TAPResults
245 """
--> 246 return self.create_query(
247 query, language=language, maxrec=maxrec, uploads=uploads,
248 **keywords).execute()

~/miniconda3/envs/jwql-py3.8/lib/python3.8/site-packages/pyvo/dal/tap.py in execute(self)
940 for errors parsing the VOTable response
941 """
--> 942 return TAPResults(self.execute_votable(), url=self.queryurl, session=self._session)
943
944 def submit(self, post=False):

~/miniconda3/envs/jwql-py3.8/lib/python3.8/site-packages/pyvo/dal/query.py in execute_votable(self, post)
243 except Exception as e:
244 self.raise_if_error()
--> 245 raise DALFormatError(e, self.queryurl)
246
247 def raise_if_error(self):

DALFormatError: E19: None:2:9: E19: File does not appear to be a VOTABLE
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the pyvo TAPService query against http://vao.stsci.edu/caomtap/tapservice.aspx and inspect the returned response before VOTable parsing. Compare the response with what pyvo expects; done means the JWQL query returns observationID results without the file-not-VOTABLE or DALFormatError exceptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.