Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return just query URL without doing the query #3144

Open
pllim opened this issue Dec 4, 2024 · 5 comments
Open

Return just query URL without doing the query #3144

pllim opened this issue Dec 4, 2024 · 5 comments

Comments

@pllim
Copy link
Member

pllim commented Dec 4, 2024

This was brought up by @ejeschke at Astropy ALOHA 2024 workshop. User wishes to use Astroquery to construct a query, however user does not want to actually execute the query, but rather wants to store the final query URL for later use. This is desirable when user wants complete control on when network access happens, and not necessarily when the query was created (e.g., this query is generated by downstream in an async away).

Might be related:

@keflavich
Copy link
Contributor

This isn't possible for most services; in general, queries are performed via POST requests, not GET requests, and for such cases, the query is not encoded into the URL.

I therefore would regard this request as 'not possible'.

@pllim
Copy link
Member Author

pllim commented Dec 4, 2024

How about return it when possible and some form of exception when not?

@keflavich
Copy link
Contributor

'When possible' is limited to a small handful of the services that astroquery works with, and I don't know which ones - it would be significant effort to figure out which do and to implement param-based queries.

From a user perspective: this is why we made astroquery in the first place. There were lots of online services that provided un-reproducible workflows (you constructed a post query through the web form), and there was no easy way to do it from the command line. Astroquery exists in part to fill that role.

Addressing the original concern: Is it any more difficult to copy an astroquery query command than a URL? It shouldn't be, generally.

@pllim
Copy link
Member Author

pllim commented Dec 4, 2024

I'll have to defer to @ejeschke to elaborate on the affected use case. 🙏

@bsipocz
Copy link
Member

bsipocz commented Dec 4, 2024

Also, we'll be adding more, real async accesses, but also, a lot of the modules are switching to VO backends. So if someone wants to have this much level of control, they could use pyvo/the vo services directly at the point of need in their pipeline/processing workflow rather than passing around reverse-engineered URLs.

So, overall I agree with Adam that it it very unlikely that this feature request will be implemented, even where it is technically possible: This ask would require a significant amount of engineering that only affects a handful of modules, most of which modules are not having any observatory/archive support and thus are already maintained on volunteer and best effort level and that contains some of the reverse engineered API access.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants