Added get_query_payload kwarg to Ogle#3533
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
keflavich
left a comment
There was a problem hiding this comment.
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.
|
Oddly enough there wasn't any particular bug that prompted this. 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 I went ahead an did a quick audit of which modules have/don't have Since I came across wanting/needing |
e43ce80 to
3044635
Compare
bsipocz
left a comment
There was a problem hiding this comment.
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.
| """ | ||
| co_list = [[0, 0, 0], [3, 3, 3]] | ||
| expected_payload = '# RD NG GOOD\n0 3\n0 3\n0 3' | ||
| with pytest.warns(AstropyDeprecationWarning): |
There was a problem hiding this comment.
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 :)
|
|
||
| @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): |
There was a problem hiding this comment.
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.
3044635 to
085993c
Compare
…ion and removed OgleClass._args_to_payload
085993c to
e390b37
Compare
bsipocz
left a comment
There was a problem hiding this comment.
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.
|
Sorry I completely overlooked the docs! Thanks a bunch @bsipocz! |
|
No worries. I need to get those remote tests run for PRs, right now it's a bit of a manual process. |
Hey yall!
I added in the
get_query_payloadkwarg 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.