+1 vote
169 views

Hi, I've been trying to run some async queries to perform cone searches on Gaia data. I've successfully run the async query, and have had the status updated to "COMPLETED", but when I then try to pull the results, my notebook cell just runs for a very long time. I don't understand why I can't easily access the results after the query itself is complete, and when I try running the identical query synchronously, it returns the results table in under a minute.

With the exact code I've been working with below, the last command (the results command) has now been running for nearly 20 minutes, and I'm just not sure if I'm doing something incorrect or not. Thanks for any advice!

Here is the exact commands I've been working with:

query2 = """ 
SELECT ra, dec, parallax, pmra, pmdec, radial_velocity
FROM gaia_dr3.gaia_source 
WHERE 't' = Q3C_RADIAL_QUERY(ra, dec,16.95,-4.1,21.48)
"""
#first try synch query
first_try = gc.query(sql=query2, fmt='table')
Last executed in 53.54s

#now try the same query async
second_try = gc.query(sql=query2, async_=True)
Last executed in 167ms

gc.status(second_try)
Last executed in 199ms
'COMPLETED'

#try to get results
st_results = qc.results(token, second_try)

by sheller (130 points)
edited by 0 | 169 views

2 Answers

0 votes

Hi,

Sorry for the delay on this and thank you for your patience. 

We have been developing a new, more efficient download method and a beta version featuring this enhanced code will be available shortly.

Thank you!

Igor

by isuarezsola (890 points)
0 votes

Hi,

We created a special branch for datalab with a fix on the queryClient code that should solve this problem.

https://github.com/astro-datalab/datalab/tree/query_async_download

Could you please install it and see if it works for you?

To install it from source code simply do:
 

git clone -b query_async_download https://github.com/astro-datalab/datalab

cd datalab

python setup.py install

 Note this fix supports only python versions: 3.10 and 3.11.

Please let us know if you have any issues and if it works for you.

Thank you so much!
Igor

by isuarezsola (890 points)

449 questions

463 answers

473 comments

658 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.

Categories