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: archiving of an 'upload' job via TAP fails #234

Closed kimakan closed 1 month ago

kimakan commented 7 months ago

We provide this example in the documentation for 'scripted access'

completed_job_descriptions = tap_service.get_job_list(phases='COMPLETED')
for job_description in completed_job_descriptions:
    jobid = job_description.jobid
    job_url = tap_service.baseurl + '/async/' + jobid
    job = pyvo.dal.AsyncTAPJob(job_url, session=tap_session)
    print('Archiving: {url}'.format(url=job_url))
    job.delete() # archive job

It fails if there is a COMPLETED upload job with the following error messages

Traceback (most recent call last):
  File "/home/kmakan/code/xmmssc/tmp/test-scripted-access.py", line 34, in <module>
    job = pyvo.dal.AsyncTAPJob(job_url, session=tap_session)
  File "/home/kmakan/code/xmmssc/tmp/env/lib/python3.9/site-packages/pyvo/dal/tap.py", line 657, in __init__
    self._update()
  File "/home/kmakan/code/xmmssc/tmp/env/lib/python3.9/site-packages/pyvo/dal/tap.py", line 694, in _update
    self._job = uws.parse_job(response.raw.read)
  File "/home/kmakan/code/xmmssc/tmp/env/lib/python3.9/site-packages/pyvo/io/uws/endpoint.py", line 84, in parse_job
    return parse_for_object(source, JobFile, pedantic, filename,
  File "/home/kmakan/code/xmmssc/tmp/env/lib/python3.9/site-packages/pyvo/utils/xml/elements.py", line 64, in parse_for_object
    return object_type(
  File "/home/kmakan/code/xmmssc/tmp/env/lib/python3.9/site-packages/pyvo/io/uws/endpoint.py", line 115, in parse
    return super().parse(iterator, config)
  File "/home/kmakan/code/xmmssc/tmp/env/lib/python3.9/site-packages/pyvo/utils/xml/elements.py", line 339, in parse
    tag_mapping.get(tag, self._add_unknown_tag)(
  File "/home/kmakan/code/xmmssc/tmp/env/lib/python3.9/site-packages/pyvo/utils/xml/elements.py", line 284, in add_simplecontent
    setattr(self, attr_name, data or None)
  File "/home/kmakan/code/xmmssc/tmp/env/lib/python3.9/site-packages/pyvo/io/uws/tree.py", line 214, in executionduration
    executionduration = InDuration(float(executionduration))
TypeError: float() argument must be a string or a number, not 'NoneType'