-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Conversation
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 Report
@@ 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
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this 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.
astroquery/alma/core.py
Outdated
if p.ID == parameter_id: | ||
return p.value | ||
|
||
return None |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)...
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
d7922c0
to
170d23c
Compare
There was a problem hiding this 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.
Thank you @at88mph! |
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.