astropy / astropy/astroquery

Gaia (and Tap/TapPlus?) .search_async_jobs() broken

Open
#2,458 6 comments 0 reactions 0 assignees View on GitHub
utils.tap
Dominant language
Python
Stars
791
Forks
451
Avg merge
1d 3h
Merged PRs (30d)
4

Description

I was trying to use the `Gaia.load_async_job()` method to retrieve a job by name, but I get an AttributeError caused by [this line](https://github.com/astropy/astroquery/blob/main/astroquery/utils/tap/core.py#L1298) because `Filter` (`jobfilter`) does not have a `createUrlRequest()` method (it instead has [`.create_url_data_request()`](https://github.com/astropy/astroquery/blob/main/astroquery/utils/tap/model/filter.py#L50)). I tried fixing the method name in a local clone, but then I still get an error:

full traceback here

```python
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in
----> 1 Gaia.load_async_job(name='pw1_dr3_region')

~/projects/astropy-all/astroquery/astroquery/utils/tap/core.py in load_async_job(self, jobid, name, verbose, load_results)
483 jobfilter = Filter()
484 jobfilter.add_filter('name', name)
--> 485 jobs = self.search_async_jobs(jobfilter)
486 if jobs is None or len(jobs) < 1:
487 log.info(f"No job found for name '{name}'")

~/projects/astropy-all/astroquery/astroquery/utils/tap/core.py in search_async_jobs(self, jobfilter, verbose)
1298 data = jobfilter.create_url_data_request()
1299 if data is not None:
-> 1300 subContext = f"{subContext}?{self.__appendData(data)}"
1301 connHandler = self.__getconnhandler()
1302 response = connHandler.execute_tapget(subContext, verbose=verbose)
AttributeError: 'GaiaClass' object has no attribute '_TapPlus__appendData'
```

```python
AttributeError: 'GaiaClass' object has no attribute '_TapPlus__appendData'
```
I'm confused because the line of code is calling `self.__appendData()` but the attribute error is for `_TapPlus__appendData` -- any ideas?

Thanks!

Contributor guide

Open the contributing guide

Research direction

Start by reproducing Gaia.load_async_job(name=...) and read astroquery/utils/tap/core.py around search_async_jobs, then compare its request-building calls with astroquery/utils/tap/model/filter.py. Trace why the GaiaClass instance resolves the private helper as _TapPlus__appendData. Done means named-job loading no longer raises either AttributeError and the affected TAP behavior is covered by a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.