Skip to content

Commit

Permalink
Adding async mode to query_region, too
Browse files Browse the repository at this point in the history
  • Loading branch information
bsipocz committed Feb 4, 2025
1 parent ef6c719 commit dbac24c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions astroquery/ipac/irsa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def query_tap(self, query, *, async_mode=False, maxrec=None):
----------
query : str
ADQL query to be executed
maxrec : int
async_mode : bool, optional
if True query is run as an async job
maxrec : int, optional
maximum number of records to return
Returns
Expand Down Expand Up @@ -136,7 +138,7 @@ def list_collections(self):
@deprecated_renamed_argument(("selcols", "cache", "verbose"), ("columns", None, None), since="0.4.7")
def query_region(self, coordinates=None, *, catalog=None, spatial='Cone',
radius=10 * u.arcsec, width=None, polygon=None,
get_query_payload=False, columns='*',
get_query_payload=False, columns='*', async_mode=False,
verbose=False, cache=True):
"""
Queries the IRSA TAP server around a coordinate and returns a `~astropy.table.Table` object.
Expand Down Expand Up @@ -171,6 +173,8 @@ def query_region(self, coordinates=None, *, catalog=None, spatial='Cone',
Defaults to `False`.
columns : str, optional
Target column list with value separated by a comma(,)
async_mode : bool, optional
if True query is run as an async job
Returns
-------
Expand Down Expand Up @@ -220,7 +224,7 @@ def query_region(self, coordinates=None, *, catalog=None, spatial='Cone',

if get_query_payload:
return adql
response = self.query_tap(query=adql)
response = self.query_tap(query=adql, async_mode=async_mode)

Check warning on line 227 in astroquery/ipac/irsa/core.py

View check run for this annotation

Codecov / codecov/patch

astroquery/ipac/irsa/core.py#L227

Added line #L227 was not covered by tests

return response.to_table()

Expand Down

0 comments on commit dbac24c

Please sign in to comment.