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

If no epacems_api_key, return None instead of throwing an exception #500

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

e-belfer
Copy link
Member

@e-belfer e-belfer commented Dec 17, 2024

Overview

What problem does this address?
Right now if there's no EPACEMS_API_KEY set in the environment, an error is thrown whether or not a user is actually archiving EPA CEMS data. This came up in another repository importing the pudl-archiver code to run an archiver.

What did you change in this PR?
Switched from using os.environ['EPACEMS_API_KEY'] which raises an error if this doesn't exist, to os.environ.get("EPACEMS_API_KEY") which will return None. This will still fail if the EPA CEMS API key is being called in the archiver, but will allow people to run other archivers without making a fake EPA CEMS API key environment variable.

Testing

How did you make sure this worked? How can a reviewer verify this?

To-do list

Tasks

Preview Give feedback

@e-belfer e-belfer added bug Something isn't working epacems labels Dec 17, 2024
@e-belfer e-belfer requested a review from zschira December 17, 2024 21:25
@e-belfer e-belfer self-assigned this Dec 17, 2024
Copy link
Member

@zschira zschira left a comment

Choose a reason for hiding this comment

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

Looks good!

@e-belfer e-belfer merged commit b4e320a into main Dec 18, 2024
3 checks passed
@e-belfer e-belfer deleted the call-epacems-flexibly branch December 18, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working epacems
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants