Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about tracking upload jobs using using Gaia TAP+ #2925

Open
javierggt opened this issue Jan 16, 2024 · 4 comments
Open

Questions about tracking upload jobs using using Gaia TAP+ #2925

javierggt opened this issue Jan 16, 2024 · 4 comments
Labels

Comments

@javierggt
Copy link

javierggt commented Jan 16, 2024

I am running a code that is equivalent to the one in the docs (adding the job argument missing in the docs), and I have two questions.

This is the code:

from astroquery.gaia import Gaia

Gaia.login()

j1 = Gaia.launch_job_async(
    "select top 10 * from gaiadr3.gaia_source",
    name='test',
    background=False
)
job = Gaia.upload_table_from_job(job=j1)

The call to upload_table_from_job returns immediately, but the return value is None (whereas from the docs I assumed it would return something). The upload in my actual application takes a while, so I want my script to wait until it is uploaded, but I do not know how to have the script wait. One workaround I thought of is to wait until the table exists.

The questions are:

  • How do you retrieve the upload job? It is not returned by upload_table_from_job
  • The jobs listed by Gaia.list_async_jobs never have the name set, so I can't easily identify them, and wonder if I'm missing something. Is there a way to have the job names I see in the Gaia archive web page show up in the tap.model.job.Job?
@cosmoJFH
Copy link

Dear @javierggt, in the gaia help page https://www.cosmos.esa.int/web/gaia-users/archive/use-cases#ClusterAnalysisPythonTutorial you can see that right after calling the function launch_job_async you can use the method results = job.get_results().

The documentation of this function says:

This method will block if the job is asynchronous and the job has not finished yet.

@javierggt
Copy link
Author

Hi Cosmo, thanks for the answer, but I think that does not answer my question. I do not want to get the results, I want to upload them to a table so I can use them later.

My question is motivated by wanting my script to know when uploading finished so I can launch a query to use the table, and in general to know when jobs finished without having to check the web page myself.

@bsipocz bsipocz added the gaia label Jan 16, 2024
@cosmoJFH
Copy link

I think that the only way to know that your table has been created in the system is at the time a message like this is printed

INFO: Created table 't1705434281894O' from job: '1705434281894O'.

I think that the execution of the function upload_table_from_job is blocked till the task has been completed, isn't it?

@javierggt
Copy link
Author

javierggt commented Jan 16, 2024

I think that the execution of the function upload_table_from_job is blocked till the task has been completed, isn't it?

No, it isn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants