AsyncTAPJob

class pyvo.dal.AsyncTAPJob(url, session=None)[source]

Bases: object

This class represents a UWS TAP Job.

initialize the job object with the given url and fetch remote values

Parameters
urlstr

the job url

Attributes Summary

destruction

datetime after which the job results are deleted automatically.

execution_duration

maximum execution duration as TimeDelta.

job

all up-to-date uws job infos as dictionary

job_id

the job id

owner

job owner (if applicable)

phase

the current query phase

query

the job query

quote

estimated runtime

result

The job result if exists

result_uri

the uri of the result

result_uris

a list of the last result uri's

results

The job results if exists

url

the job url

uws_version

the version of the UWS serving this async job

Methods Summary

abort()

aborts the job / change phase to ABORT

create(baseurl, query[, language, maxrec, ...])

creates a async tap job on the server under baseurl

delete()

deletes the job.

fetch_result()

returns the result votable if query is finished

raise_if_error()

raise a exception if theres an error

run()

starts the job / change phase to RUN

upload(**kwargs)

upload a table to the job.

wait([phases, timeout])

waits for the job to reach the given phases.

Attributes Documentation

destruction

datetime after which the job results are deleted automatically. read-write

execution_duration

maximum execution duration as TimeDelta.

job

all up-to-date uws job infos as dictionary

job_id

the job id

owner

job owner (if applicable)

phase

the current query phase

query

the job query

quote

estimated runtime

result

The job result if exists

result_uri

the uri of the result

result_uris

a list of the last result uri’s

results

The job results if exists

url

the job url

uws_version

the version of the UWS serving this async job

Asynchronous TAP jobs are managed using a standard called Universal Worker Service (UWS). For instance, starting version 1.1, you can have long polls, which save on monitoring requests. Normal users generally will not have to look at this.

Methods Documentation

abort()[source]

aborts the job / change phase to ABORT

classmethod create(baseurl, query, language='ADQL', maxrec=None, uploads=None, session=None, **keywords)[source]

creates a async tap job on the server under baseurl

Parameters
baseurlstr

the TAP baseurl

querystr

the query string

languagestr

specifies the query language, default ADQL. useful for services which allow to use the backend query language.

maxrecint

the maximum records to return. defaults to the service default

uploadsdict

a mapping from table names to objects containing a votable

sessionobject

optional session to use for network requests

delete()[source]

deletes the job. this object will become invalid.

fetch_result()[source]

returns the result votable if query is finished

raise_if_error()[source]

raise a exception if theres an error

Raises
DALQueryError

if theres an error

run()[source]

starts the job / change phase to RUN

upload(**kwargs)[source]

upload a table to the job. the job must not been started.

wait(phases=None, timeout=600.0)[source]

waits for the job to reach the given phases.

Parameters
phaseslist

phases to wait for

Raises
DALServiceError

if the job is in a state that won’t lead to an result