Skip to content

Commit 9073293

Browse files
authored
Merge pull request #3356 from d-giles/3276-longURI
URL Length check for locate_data
2 parents 9a7fd43 + 51ef0b8 commit 9073293

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ heasarc
4949
- Add support for astropy.table.Row in Heasarc.download_data and Heasarc.locate_data. [#3270]
5050
- Heasarc.locate_data returns empty rows with an error in the error_message column if there are
5151
no data associated with that row rather than filtering it out. [#3275]
52+
- Heasarc.locate_data changed to use POST request instead of GET to accomodate large requests. [#3356]
5253

5354
imcce
5455
^^^^^

astroquery/heasarc/core.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,13 +517,18 @@ def locate_data(self, query_result=None, catalog_name=None):
517517

518518
# datalink url
519519
dlink_url = f'{self.VO_URL}/datalink/{catalog_name}'
520-
521520
query = pyvo.dal.adhoc.DatalinkQuery(
522521
baseurl=dlink_url,
523522
id=query_result['__row'],
524523
session=self._session
525524
)
526-
dl_result = query.execute().to_table()
525+
526+
dl_result = pyvo.dal.DALResults(
527+
query.execute_votable(post=True),
528+
url=query.queryurl,
529+
session=query._session
530+
).to_table()
531+
527532
# include rows that have directory links (i.e. data) and those
528533
# that report errors (usually means there are no data products)
529534
dl_result = dl_result[np.ma.mask_or(

0 commit comments

Comments
 (0)