pyvo icon indicating copy to clipboard operation
pyvo copied to clipboard

Support for service redirects

Open andamian opened this issue 3 years ago • 3 comments

Your opinion please.

This is a request from ALMA but it might apply to other services too. Their top site almascience.org/tap automatically redirects to one of the mirror sites. They would like to see the direct searches to the top URL work which currently is not possible because POST redirects are no supported.

The way we solved this problem in astroquery.alma was to do a GET on the capabilities of the top URL and use the resulted URL for the subsequent searches/actions.

Do people think it would be a good idea to add something similar to the service constructors in PyVO? Is it worth the extra overhead of the GET call for this enhancement? I'll do the implementation if the feedback is positive.

andamian avatar Jan 16 '23 22:01 andamian

On Mon, Jan 16, 2023 at 02:57:10PM -0800, Adrian wrote:

Do people think it would be a good idea to add something similar to the service constructors in PyVO? Is it worth the extra overhead of the GET call for this enhancement? I'll do the implementation if the feedback is positive.

Me, I'd be moderately in favour of requesting capabilities while constructing a TAP service. That should generally be cheap, and (in contrast to /tables) the data transferred will be just a few k (it's 23k for my site, and I think that's one of the larger capabilities out there). Also, if something goes wrong while retrieving capabilities, it stands to reason that the whole service is going to be broken, and it's perhaps even preferable if things break early in that case -- if things fail while querying, people have to pick apart errors because of their queries from those resulting from a broken service.

Oh, and of course retrieving capabilities first is also what TOPCAT does.

The main downside that comes to my mind is that tests will probably be a bit harder to write. But I'd be willing to pay that price.

msdemlei avatar Jan 17 '23 09:01 msdemlei

Would this https://github.com/astropy/pyvo/issues/96 be the same feature request?

bsipocz avatar Jan 24 '23 22:01 bsipocz

This feature just resolves the service URL - if that mirror returns an error it's game over. #96 wants to make the client more resilient by providing it with alternatives. So they are not quite the same.

andamian avatar Jan 25 '23 08:01 andamian