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

Fix atomic caching infinite loop #2339

Merged
merged 9 commits into from
Mar 29, 2022

Conversation

bsipocz
Copy link
Member

@bsipocz bsipocz commented Mar 27, 2022

This is to fix #2338. I made atomic commits to make the motivation clear for each individual fix, as this PR fixes a few separate issues.

#1937 can be merged after this one, it passed locally on top of this branch.

I'll add a changelog once we're happy with the scope of this.

@bsipocz bsipocz added this to the v0.4.7 milestone Mar 27, 2022
@bsipocz bsipocz requested a review from keflavich March 27, 2022 00:45
Copy link
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.

All looks good to me.

self.__default_form_values = self._get_default_form_values(form)

return self.__default_form_values
response = self._request("GET", url=self.FORM_URL, params={},
Copy link
Contributor

Choose a reason for hiding this comment

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

you changed data={} to params={} here... I think either way, we could just exclude this? It's a very minor thing but I'm not sure what purpose it serves.

Copy link
Member Author

Choose a reason for hiding this comment

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

This was indeed a red herring for the problem but I kept it as it's still a fix even as it's an empty dict so it shouldn't matter in practice. (afaik data doesn't have any effect for a GET query, it takes a params dict (while POST can have either or both).)

astroquery/atomic/core.py Outdated Show resolved Hide resolved
@bsipocz
Copy link
Member Author

bsipocz commented Mar 29, 2022

So, with the latest commit I needed to bring back not setting the default values at initialization to make sure we're not reaching the internet at init time, to allow non-remote tests to pass. Not ideal, but it works, and honestly I don't expect this module to be any big data bottleneck, so probably not worth spending much more time on finding a more optimal solution.

@codecov
Copy link

codecov bot commented Mar 29, 2022

Codecov Report

Merging #2339 (9163f29) into main (d421fcb) will decrease coverage by 0.01%.
The diff coverage is 29.62%.

@@            Coverage Diff             @@
##             main    #2339      +/-   ##
==========================================
- Coverage   63.41%   63.40%   -0.02%     
==========================================
  Files         131      131              
  Lines       17043    17045       +2     
==========================================
- Hits        10808    10807       -1     
- Misses       6235     6238       +3     
Impacted Files Coverage Δ
astroquery/atomic/core.py 35.48% <29.62%> (-1.41%) ⬇️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@bsipocz
Copy link
Member Author

bsipocz commented Mar 29, 2022

Given the thumbs up and approval above, I go ahead and merge this, to get one more out of the way...

@bsipocz bsipocz merged commit f032596 into astropy:main Mar 29, 2022
@bsipocz
Copy link
Member Author

bsipocz commented Mar 29, 2022

🤦‍♀️ - I didn't rerun the remote tests :(

bsipocz added a commit to tinuademargaret/astroquery that referenced this pull request Mar 29, 2022
@bsipocz
Copy link
Member Author

bsipocz commented Mar 29, 2022

The fix that removes the extraneous lines used for debugging is in #1937. With that fix all atomic tests pass on that PR, and thus it's good to go.

volodymyrss pushed a commit to oda-hub/astroquery that referenced this pull request Mar 30, 2022
mhsarmiento pushed a commit to esdc-esac-esa-int/astroquery that referenced this pull request May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite loop for doctesting: caching issue with atomic
2 participants