Open adrn opened 2 years ago
The attribute name getting modified like that is the result of name mangling. The __appendData()
method is defined in the Tap
class, so it can be accessed as _Tap__appendData()
.
Ah, thanks -- I've never used this before. In this case, GaiaClass
subclasses TapPlus
, which subclasses Tap
where the method lives. It doesn't seem to like that the method lives in a grandparent class -- do we need to implement a custom search_async_jobs()
on GaiaClass
?
It is not obvious to me that overwriting search_async_jobs()
would be the best solution. I would say the problem is that __appendData()
is defined in Tap
, but only used in TapPlus
, which is especially confusing because of the name mangling. Does moving __appendData()
from Tap
to TapPlus
help fixing GaiaClass.load_async_job()
?
That might also be a path forward but I'm not really familiar with the source code in astroquery.utils.tap
or where it's used (in jwst and gaia, at least)!
git grep appendData
finds two matches in all of astroquery
. One of them is the method definition in Tap
, the other is included in your traceback. Moving the method to TapPlus
should therefore not break anything.
A possible solution to the issue described by @adrn has been implemented in the PR https://github.com/astropy/astroquery/pull/2967
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 becauseFilter
(jobfilter
) does not have acreateUrlRequest()
method (it instead has.create_url_data_request()
). 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)I'm confused because the line of code is calling
self.__appendData()
but the attribute error is for_TapPlus__appendData
-- any ideas?Thanks!