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

BUG: fix for alma timeout #2535

Merged
merged 2 commits into from
Sep 27, 2022
Merged

BUG: fix for alma timeout #2535

merged 2 commits into from
Sep 27, 2022

Conversation

at88mph
Copy link
Contributor

@at88mph at88mph commented Sep 22, 2022

Add timeouts and test fixes.

DataLink tests were failing to traverse the ad-hoc DataLink services. I made some test and code fixes in order to push through the timeout changes.

@at88mph
Copy link
Contributor Author

at88mph commented Sep 22, 2022

This PR also includes fixes for something unrelated, but was necessary to pass all the tests. Can someone advise on how to proceed with that? Are the fixes better off in a separate Issue?

@codecov
Copy link

codecov bot commented Sep 22, 2022

Codecov Report

Merging #2535 (5a33aa1) into main (8898b54) will increase coverage by 0.02%.
The diff coverage is 86.95%.

@@            Coverage Diff             @@
##             main    #2535      +/-   ##
==========================================
+ Coverage   63.18%   63.21%   +0.02%     
==========================================
  Files         133      133              
  Lines       17236    17250      +14     
==========================================
+ Hits        10891    10905      +14     
  Misses       6345     6345              
Impacted Files Coverage Δ
astroquery/query.py 58.54% <0.00%> (ø)
astroquery/alma/core.py 49.17% <90.90%> (+1.34%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bsipocz bsipocz changed the title Fixes #2405 BUG: fix for alma timeout Sep 22, 2022
@bsipocz bsipocz added this to the v0.4.7 milestone Sep 22, 2022
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.

Mostly lgtm, I just had one small nitpick about a dangling return statement.

if p.ID == parameter_id:
return p.value

return None
Copy link
Contributor

@keflavich keflavich Sep 23, 2022

Choose a reason for hiding this comment

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

A trailing return or return None is redundant
EDIT: removed suggestion

Copy link
Member

Choose a reason for hiding this comment

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

PEP 8 says:

... If any return statement returns an expression, any return statements where no value is returned should explicitly state this as return None, and an explicit return statement should be present at the end of the function (if reachable)...

Copy link
Contributor

Choose a reason for hiding this comment

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

Huh. Thanks. This is the first time I think I really disagree with pep8, but ok.

Copy link
Member

Choose a reason for hiding this comment

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

Reading a bit up on it, yes, maybe we need to add these back for all over the library, but atm pycodestyle/flake8 is not complaining, and if we run and check something more strict like pylint, we'll suffocating under linter errors.

So I removed the line (after all the only aim for this particular PEP8 rule is to be consistency, and removing this line is in fact more consistent with the rest of the library), and will merge once CI pass.

@@ -518,8 +522,8 @@ def run_sync(self, uid):
alma._datalink = MockDataLinkService()
result = alma.get_data_info(uids='uid://A001/X12a3/Xe9', expand_tarfiles=True)

# Entire expanded structure is 61 links long.
assert len(result) == 61
# Entire expanded structure is 19 links long.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this something that will change? If so, add the date in a comment. If not, it's fine to leave this as-is - but it would be good to leave some note about what to do if the number changes.

Copy link
Member

Choose a reason for hiding this comment

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

the date is in the commit, so I left this as is for now. If it starts failing we can think about modifications.

@bsipocz bsipocz dismissed keflavich’s stale review September 27, 2022 20:34

review has been addressed

Copy link
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.

Adding the approval as all the previous review comments have been addressed.

@bsipocz
Copy link
Member

bsipocz commented Sep 27, 2022

Thank you @at88mph!

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.

None yet

4 participants