Skip to content

Gaia.launch_job does not work when uploading tables on the fly #2884

Closed
@ManonMarchand

Description

@ManonMarchand

I'm doing something very similar to the example in section 1.5 Synchronous query on an ‘on-the-fly’ uploaded table of the Gaia module. When calling Gaia.launch_job with an uploaded table I encounter a TypeError.

To reproduce

Here is a minimal non-working example

from astropy.table import Table
from astroquery.gaia import Gaia
xmm_to_upload = Table([[0, 0, 0], [0, 0, 0], ['a', 'b', 'c']], names=['RA_x', 'DEC_x', 'TARGET'])
query = """
SELECT TOP 1000 gaia.source_id, gaia.ra, gaia.dec, gaia.parallax, xmm.TARGET
FROM TAP_UPLOAD.xmm AS xmm
LEFT JOIN gaiadr3.gaia_source AS gaia
ON DISTANCE(POINT(xmm.RA_x, xmm.DEC_x),POINT(gaia.ra, gaia.dec)) < 0.2
"""
j = Gaia.launch_job(query=query, upload_resource=xmm_to_upload, upload_table_name='xmm')

Traceback of the error

And its output

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/manon.marchand/.conda/envs/astroquery-dev/lib/python3.11/site-packages/astroquery/gaia/core.py", line 851, in launch_job
    return TapPlus.launch_job(self, query=query, name=name,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/manon.marchand/.conda/envs/astroquery-dev/lib/python3.11/site-packages/astroquery/utils/tap/core.py", line 281, in launch_job
    response = self.__launchJobMultipart(query=query,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/manon.marchand/.conda/envs/astroquery-dev/lib/python3.11/site-packages/astroquery/utils/tap/core.py", line 615, in __launchJobMultipart
    response = self.__connHandler.execute_tappost(context,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: TapConn.execute_tappost() takes from 3 to 4 positional arguments but 5 were given

edit: and my astroquery version is the master branch on commit 8c15f2f

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions