-
-
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
Log a warning if there are download duplicates for MAST #2510
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2510 +/- ##
==========================================
+ Coverage 62.97% 62.98% +0.01%
==========================================
Files 133 133
Lines 17308 17308
==========================================
+ Hits 10900 10902 +2
+ Misses 6408 6406 -2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
astroquery/mast/observations.py
Outdated
@@ -827,8 +827,8 @@ def _remove_duplicate_products(self, data_products): | |||
unique_products = unique(data_products, keys="dataURI") | |||
number_unique = len(unique_products) | |||
if number_unique < number: | |||
warnings.warn(f"{number - number_unique} of {number} products were duplicates." | |||
f"Only downloading {number_unique} unique product(s).", DuplicateResultsWarning) | |||
log.warning(f"{number - number_unique} of {number} products were duplicates. " |
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.
This feels more like an info
level message, but we don't really have a clear policy on the boundaries, so you can keep it as a warning if you prefer.
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.
Agree. I will change it.
be56800
to
f6ab293
Compare
f6ab293
to
b348489
Compare
Thanks @jdavies-st! |
This is a follow-up PR in response to #2497 (comment)
Instead of issuing a
warnings.warn
when duplicate downloads are culled, this PR useslog.warning
. I've removed the warning class I'd created and instead just logged the warning. Test is updated as well.