AsyncTAPJob

class pyvo.dal.tap.AsyncTAPJob(url)[source]

Bases: object

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

Parameters:

url : str

the job url

Attributes Summary

destruction datetime after which the job results are deleted automatically.
execution_duration maximum execution duration. read-write
job all up-to-date uws job infos as dictionary
jobId the job id
owner job owner (if applicable)
phase the current query phase
quote estimated runtime
result_uri the first result uri
result_uris a list of the last result uri’s
url the job url

Methods Summary

abort() aborts the job / change phase to ABORT
create(baseurl, query[, language, maxrec, ...]) creates a async tap job on the server unter baseurl
delete() deletes the job. this object will become invalid.
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
wait([phases, interval, increment, ...]) 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. read-write

job

all up-to-date uws job infos as dictionary

jobId

the job id

owner

job owner (if applicable)

phase

the current query phase

quote

estimated runtime

result_uri

the first result uri

result_uris

a list of the last result uri’s

url

the job url

Methods Documentation

abort()[source]

aborts the job / change phase to ABORT

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

creates a async tap job on the server unter baseurl

Parameters:

baseurl : str

the TAP baseurl

query : str

the query string

language : str

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

maxrec : int

specifies the maximum records to return. defaults to the service default

uploads : dict

a mapping from table names to file like objects containing a votable

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

wait(phases={'ERROR', 'COMPLETED', 'ABORTED'}, interval=1.0, increment=1.2, giveup_after=None, timeout=None)[source]

waits for the job to reach the given phases.

Parameters:

phases : list

phases to wait for

interval : float

poll interval in seconds. defaults to 1

increment : float

poll interval increments. defaults to 1.2

giveup_after : int

raise an :py:class`~pyvo.dal.query.DALServiceError` after n tries

timeout : float

raise an :py:class`~pyvo.dal.query.DALServiceError` after n seconds

Raises:

DALServiceError

if the timeout is exceeded