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

Using astropy's PyVO to make URL calls. #129

Closed
wants to merge 7 commits into from

Conversation

NucleonGodX
Copy link
Contributor

@NucleonGodX NucleonGodX commented Jun 29, 2024

This PR is a part of GSoC-2024, this PR is tackling the issue(#32 ) that is using astroquery's tap plus to do URL calls.

Fixes #32

@NucleonGodX NucleonGodX marked this pull request as draft June 29, 2024 17:35
@NucleonGodX NucleonGodX marked this pull request as ready for review July 1, 2024 14:32
@NucleonGodX NucleonGodX closed this Jul 7, 2024
@NucleonGodX NucleonGodX reopened this Jul 7, 2024
@NucleonGodX NucleonGodX marked this pull request as draft July 7, 2024 09:23
pyproject.toml Outdated Show resolved Hide resolved
tox.ini Outdated Show resolved Hide resolved
tox.ini Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@NucleonGodX NucleonGodX marked this pull request as ready for review July 9, 2024 18:21
return qrt

def add_join_to_query(query: list[str], data_table: str, instrument_table: str):
"""
Construct the WHERE, FROM, and SELECT parts of the ADQL query.
Construct the WHERE, FROM, and SELECT parts of the SQL query.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand, before it was URL-encoded ADQL, now it is just ADQL. Transforming the +s to spaces don't make this SQL.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alrighty, makes sense!

@ebuchlin
Copy link

Following this comment on the parent issue #32, TapPlus now recommends to use PyVO instead.

Most of line changes in this PR were to make the ADQL queries non-URL-escaped. The transition to PyVO should then not be too difficult as a next step. Shall we do this? (and then change the title of the PR)

@nabobalis
Copy link
Contributor

Most of line changes in this PR were to make the ADQL queries non-URL-escaped. The transition to PyVO should then not be too difficult as a next step. Shall we do this? (and then change the title of the PR)

Yes we should do that.

@NucleonGodX
Copy link
Contributor Author

Following this comment on the parent issue #32, TapPlus now recommends to use PyVO instead.

Most of line changes in this PR were to make the ADQL queries non-URL-escaped. The transition to PyVO should then not be too difficult as a next step. Shall we do this? (and then change the title of the PR)

Yep sounds good, also I wanted to ask about one thing, by using these external call methods we restrict the "REQUESTS" to be strictly doQuery, as one of the issues raised a few days back suggested to use other REQUESTS methods to query by distance.
So maybe for more diverse queries we would need basic soar payload construction? So till now soar has been using only doQuery method but if we are interested in incorporating other request methods, using anything for external calls maybe won't be a great idea, as I have noticed both TapPlus and PyVo internally sets "REQUESTS" to doQuery only.
I need your thoughts on this. @ebuchlin @nabobalis @hayesla .

@nabobalis
Copy link
Contributor

If we need to add support for other queries, we should check upstream with pyvo and then implement it there. That is my immediate thought.

@NucleonGodX
Copy link
Contributor Author

Alright, l'll migrate this PR to using PyVo for now.

@NucleonGodX NucleonGodX changed the title Using Astroquery's tap plus to make URL calls. Using astropy's PyVO to make URL calls. Jul 12, 2024
@ebuchlin
Copy link

So maybe for more diverse queries we would need basic soar payload construction? So till now soar has been using only doQuery method but if we are interested in incorporating other request methods, using anything for external calls maybe won't be a great idea, as I have noticed both TapPlus and PyVo internally sets "REQUESTS" to doQuery only. I need your thoughts on this. @ebuchlin @nabobalis @hayesla .

I don't know, so I've asked in this comment on the solar distance issue #134.

Going back to requests seems to be a step backwards (although the non-URL encoded ADQL query can still be passed to requests, by using the request payload instead of building the full URL by hand).

@hayesla
Copy link
Member

hayesla commented Aug 6, 2024

OK, so we have discussed this on our weekly calls. And I think the decision was just to punt this for the moment? Am I recalling this correctly?

@nabobalis
Copy link
Contributor

OK, so we have discussed this on our weekly calls. And I think the decision was just to punt this for the moment? Am I recalling this correctly?

Yes that is correct.

@hayesla
Copy link
Member

hayesla commented Aug 6, 2024

Ok great. I think maybe we should close this PR for the moment, but link it to the original issue. Is that ok with you @NucleonGodX ?

@NucleonGodX
Copy link
Contributor Author

Ok great. I think maybe we should close this PR for the moment, but link it to the original issue. Is that ok with you @NucleonGodX ?

Yep, thats perfectly fine.

@nabobalis nabobalis closed this Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use astroquery.utils.tap rather than making our own URL calls
4 participants