Skip to content

Fix atomic caching infinite loop#2339

Merged
bsipocz merged 9 commits into
astropy:mainfrom
bsipocz:atomic_fix_default_values
Mar 29, 2022
Merged

Fix atomic caching infinite loop#2339
bsipocz merged 9 commits into
astropy:mainfrom
bsipocz:atomic_fix_default_values

Conversation

@bsipocz

@bsipocz bsipocz commented Mar 27, 2022

Copy link
Copy Markdown
Member

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

@keflavich keflavich left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread astroquery/atomic/core.py Outdated
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
Copy Markdown
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
Copy Markdown
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).)

Comment thread astroquery/atomic/core.py Outdated
@bsipocz

bsipocz commented Mar 29, 2022

Copy link
Copy Markdown
Member Author

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

codecov Bot commented Mar 29, 2022

Copy link
Copy Markdown

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

bsipocz commented Mar 29, 2022

Copy link
Copy Markdown
Member Author

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

bsipocz commented Mar 29, 2022

Copy link
Copy Markdown
Member Author

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

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

bsipocz commented Mar 29, 2022

Copy link
Copy Markdown
Member Author

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