Skip to content

Astrometry.net: Improvements to API key warnings/errors#2483

Merged
bsipocz merged 3 commits into
astropy:mainfrom
astrofrog:api-key-error
Aug 17, 2022
Merged

Astrometry.net: Improvements to API key warnings/errors#2483
bsipocz merged 3 commits into
astropy:mainfrom
astrofrog:api-key-error

Conversation

@astrofrog

Copy link
Copy Markdown
Member

Possible fix for #2482 - only raise an error about missing API key when it is needed, otherwise user doesn't have chance to set it before the warning is emitted.

… about API key before user has had chance to set it.
@codecov

codecov Bot commented Aug 8, 2022

Copy link
Copy Markdown

Codecov Report

Merging #2483 (ed1f080) into main (b1fcfff) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2483      +/-   ##
==========================================
- Coverage   62.92%   62.91%   -0.02%     
==========================================
  Files         133      133              
  Lines       17302    17308       +6     
==========================================
+ Hits        10888    10889       +1     
- Misses       6414     6419       +5     
Impacted Files Coverage Δ
astroquery/astrometry_net/core.py 47.64% <100.00%> (-2.36%) ⬇️
astroquery/alma/core.py 43.35% <0.00%> (+0.55%) ⬆️

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

@bsipocz bsipocz added this to the v0.4.7 milestone Aug 8, 2022

@bsipocz bsipocz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you, LGTM.

I'll wait until the end of this week to give @mwcraig a chance to review, too, if he wants to.

@mwcraig mwcraig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks fine, though I have one suggestion.

Comment thread astroquery/astrometry_net/core.py Outdated
Astrometry.net API key not set. You should either set this in the astroquery configuration file using:

[astrometry_net]
api_key = qwdqwjnoi12ioj

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would it be better to use something that is obviously not a key here? I assume the value here isn't a valid key
but something like XXX or FILL_IN_YOUR_KEY might be better.

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.

Ok sounds good, I can do that

@bsipocz
bsipocz merged commit 68d233a into astropy:main Aug 17, 2022
@bsipocz

bsipocz commented Aug 17, 2022

Copy link
Copy Markdown
Member

Thanks @astrofrog!

@astrofrog

Copy link
Copy Markdown
Member Author

Thanks for wrapping this up @bsipocz!

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.

3 participants