Skip to content

Added get_query_payload kwarg to Ogle#3533

Merged
bsipocz merged 6 commits intoastropy:mainfrom
nkphysics:get_query_payload-ogle
Feb 21, 2026
Merged

Added get_query_payload kwarg to Ogle#3533
bsipocz merged 6 commits intoastropy:mainfrom
nkphysics:get_query_payload-ogle

Conversation

@nkphysics
Copy link
Copy Markdown
Member

Hey yall!

I added in the get_query_payload kwarg into the Ogle module per #2040.
Its a relatively small addition.
For the tests my thought process was to cover all the existing test cases payloads.
I wasn't sure about the nested lists because of the potential deprecation, but I figured there's no harm in including tests for it since its working right now.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.66%. Comparing base (3881ee9) to head (12d9357).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3533      +/-   ##
==========================================
- Coverage   72.67%   72.66%   -0.01%     
==========================================
  Files         219      219              
  Lines       20485    20478       -7     
==========================================
- Hits        14887    14880       -7     
  Misses       5598     5598              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@keflavich keflavich left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@nkphysics did anything specific prompt this? i.e., was there a particular bug you were hunting down that led you to this fix? I don't mind general PRs to improve the consistency of astroquery modules, but I suspect there was more purpose behind this one.

@nkphysics
Copy link
Copy Markdown
Member Author

Oddly enough there wasn't any particular bug that prompted this.
I got a few deprecation warnings (this seems to be common but I only recently started dipping into ogle data) when using it which prompted me to start poking around and looking at the source code after get_query_payload=True didn't work.

I remembered that last year I came across #2040 when something happened with skyview. I don't quite remember fully what happened with that, but in #3318 I ended up adding get_query_payload to skyview, and just figured since I came across this again I'd do the same for ogle.

I went ahead an did a quick audit of which modules have/don't have get_query_payload kwargs and dropped the list in #2040.

Since I came across wanting/needing get_query_payload twice now, I figure that when I find some spare time I can dedicate to this, I may end up trying to add this into other modules where possible.
No promises, but seems worthwhile.

@nkphysics nkphysics force-pushed the get_query_payload-ogle branch from e43ce80 to 3044635 Compare February 16, 2026 23:35
@bsipocz bsipocz added the ogle label Feb 17, 2026
@bsipocz bsipocz added this to the 0.4.12 milestone Feb 17, 2026
Copy link
Copy Markdown
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

Thanks!

Overall looks good, but it would be better if the new kwarg was placed into the method where all the other kwargs are handled, so we can have it listed in the docstring.

Comment thread astroquery/ogle/tests/test_ogle.py Outdated
"""
co_list = [[0, 0, 0], [3, 3, 3]]
expected_payload = '# RD NG GOOD\n0 3\n0 3\n0 3'
with pytest.warns(AstropyDeprecationWarning):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I appreciate covering this with tests, but overall I think we should instead remove this mode of passing non coordinates altogether; as we added that deprecation warning 6 years ago :)

Comment thread astroquery/ogle/core.py Outdated

@prepend_docstr_nosections(_args_to_payload.__doc__)
def query_region_async(self, *args, **kwargs):
def query_region_async(self, *args, get_query_payload=False, **kwargs):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since this method practically pulls in everything from _args_to_payload, I would say the new parameter needs to be added there; along with listing it in the docstring.

Alternatively, if you are up for a bit more cleanup, that method can totally be moved into this one. It is only called once as I rather dislike the obstructing nature of having *args and **kwargs in the signature along with some docstring hackery.

@nkphysics nkphysics force-pushed the get_query_payload-ogle branch from 3044635 to 085993c Compare February 20, 2026 21:44
@nkphysics nkphysics force-pushed the get_query_payload-ogle branch from 085993c to e390b37 Compare February 20, 2026 21:56
@nkphysics nkphysics requested a review from bsipocz February 20, 2026 22:16
Copy link
Copy Markdown
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

Thank you! I have one small suggestion and I see one remote test failure which I'll just fix and push in a commit, too so we don't hold up merging.

Comment thread CHANGES.rst Outdated
@bsipocz bsipocz merged commit d76ac5d into astropy:main Feb 21, 2026
11 checks passed
@nkphysics
Copy link
Copy Markdown
Member Author

Sorry I completely overlooked the docs!

Thanks a bunch @bsipocz!

@nkphysics nkphysics deleted the get_query_payload-ogle branch February 21, 2026 03:37
@bsipocz
Copy link
Copy Markdown
Member

bsipocz commented Feb 21, 2026

No worries. I need to get those remote tests run for PRs, right now it's a bit of a manual process.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants