rubin-dp0 / Support

Submit Github Issues related to DP0
MIT License
1 stars 3 forks source link

MissingSchema: Invalid URL '/api/ssotap/sync': No scheme supplied #60

Closed Rich2020 closed 7 months ago

Rich2020 commented 7 months ago

When I try to use the API, I always get the above (title) error. Here is a sample of code for which I get the error:

from lsst.rsp import get_tap_service
service = get_tap_service("ssotap")
assert service is not None
query = "SELECT * FROM tap_schema.schemas"
results = service.search(query).to_table()
print(results)

I have an access token, but I have no idea where/how to use it. Not sure if that is relevant, however.

Would appreciate a hand. Thanks!

MelissaGraham commented 7 months ago

Hi @Rich2020, thanks for submitting this issue. I could not reproduce the problem, so I think we're going to need some more information.

When using the TAP service in the Notebook Aspect of the Rubin Science Platform at data.lsst.cloud, those lines of code execute fine: Screen Shot 2023-11-06 at 9 31 51 AM

I think we need to know more about what you mean when you say "try to use the API". Maybe are you using, e.g., TOPCAT as demonstrated in the API Instructions for DP0.2? Some more details and screenshots would be helpful.

Rich2020 commented 7 months ago

@MelissaGraham Thanks for the quick reply. I should have specified that I am not doing this in a Notebook: I am executing my code from the command line on MacOS using Python 3.10 and lsst-rsp 0.3.5.

MelissaGraham commented 7 months ago

Thanks for the update.

I think these draft instructions for using pyvo to access the TAP service from your laptop might be what you need: https://dp0-2.lsst.io/v/PREOPS-1284/data-access-analysis-tools/api-intro.html#use-of-pyvo-with-the-rsp-tap-service

The instructions are not yet released and, as you'll see, there are some comments in there, etc. in there. It's a bit rough, but, let us know if they fix the issue?

Rich2020 commented 7 months ago

@MelissaGraham Thank you! That document was the missing key! For reference, I was trying to use the token as described in the notebook, which did not work: notebooks/system-test/token-info.ipynb

MelissaGraham commented 7 months ago

Ah I see, and that NB executes fine in the Notebook Aspect too (all notebooks are designed for that).

Glad the pyvo instructions were helpful! We'll be getting those released into the main branch of our documentation asap.

I'm going to close this ticket but please feel free to open a new one here in the Support repo if new issues are encountered.