Can not query the dp1.Object detail even if I can query the tap_schema

I am pretty new to the data access.
I have the data right, and I can get expected result like below.
query = “”"

  • SELECT column_name, datatype, description, unit*
  • FROM tap_schema.columns*
  • WHERE table_name = ‘dp1.Object’*
    “”"
    results = service.search(query).to_table().to_pandas()
    results

However, if I try the code below, it just return Job phase is ERROR.
query = “”"

  • SELECT TOP 10*
  • obj.objectId as objectId*
  • FROM dp1.Object as obj*
  • “”"*
    job = service.submit_job(query)
    job.run()
    job.wait(phases=[‘COMPLETED’, ‘ERROR’])
    print(‘Job phase is’, job.phase)

Does anyone know how could this happen?
Thank you in advance if anyone can provide any help.

Is this from a notebook? Maybe see what information is given at the URL given by
job.url
Your post might have come through with some formatting attached so not sure if this is the same but this works for me

from lsst.rsp import get_tap_service, retrieve_query

service = get_tap_service("tap")
assert service is not None

query = "select TOP 10 "\
        "obj.objectId as objectId "\
        "FROM dp1.Object as obj "
print(query)

job = service.submit_job(query)
job.run()
job.wait(phases=['COMPLETED', 'ERROR'])
print('Job phase is', job.phase)

results = job.fetch_result().to_table().to_pandas()

print(results)

Thank you very much of replying.

Yes, I am using a jupyter notebook, but sorry I don’t understand where to find job.url.
I was at a tutorial session. I followed exactly what the lecturer provided, but it failed.
The lecturer checked and found the exact same code that can work on his machine can not work on mine. He could not figure out why.
I try to show the exact code and the file he prepared below.

from lsst.rsp import get_tap_service, retrieve_query

from astropy.table import Table
from astropy.io import fits

import pandas as pd
import matplotlib.pyplot as plt

pd.set_option(‘display.max_rows’, 50)

service = get_tap_service(“tap”)
assert service is not None

hdul = fits.open(’…/…/DATA/ECDFS.fits’)
data = hdul[1].data
table = Table(data)
xpos = table[[‘Seq’, ‘RAJ2000’,‘DEJ2000’]]

query = “”"
SELECT TOP 10
obj.objectId as objectId
FROM dp1.Object as obj
“”"

job = service.submit_job(query, uploads={“xpos”: xpos})
job.run()
job.wait(phases=[‘COMPLETED’, ‘ERROR’])
print(‘Job phase is’, job.phase)

ECDFS.fits (601.9 KB)

Hi Ji-Jia,

we have uncovered an error with temporary table uploads for usernames that include a dash in them (you are jijia-tang I believe). We’re working on a fix and it will be available by Thursday’s upgrades at the latest.

Really sorry about that. I will let you know when I expect this to work.

Hi Frossie,

Thank you very much of looking into this.
We suspect it was something wrong with my account, too.
I have no problem of waiting.

Hi, could you please try it again now and report back? We just rolled out what is hopefully a fix for your problem.

Yes, it works. Excellent. Thank you.

Great, sorry for the trouble.

1 Like