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
v0.7.0 #327
Merged
Merged
v0.7.0 #327
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add support for negative float strings
Add tests for #118
Fix links in the documentation
Add Elasticsearch5 to search scheme
Add Elasticsearch7 to search scheme
Use default option in Env.bytes()
Currently, if a `.env` file isn't found by the read_env() classmethod, it raises a UserWarning. Based on Python's logging guide, warnings.warn() is only appropriate to be raised in library code if the issue is avoidable and the client application should be modified to eliminate the warning. Conversely, it recommends logging.warning() if there is nothing the client application can do about the situation, but the event should still be noted (see ref1). In this particular case, the function is working with `.env` files that should only ever exist in development environments, which means that the function will erroneously warn the consumer in production and staging environments. With this in mind, I believe the most sensible thing to do would be to convert read_env from using the warnings module to using the logging module. Additionally, since the lack of a `.env` file is going to occur regularly during normal operation of the program, I also believe that this should be downgraded to an INFO level message from a WARNING level message. #243 requests that the .env file be made optional, and as far as I can the .env file is indeed optional, it's just that a UserWarning is being raised instead of a logged message. With that in mind, I'm referencing it as being closed by this change. ref1: https://docs.python.org/3/howto/logging.html#when-to-use-logging fixes: #243
…tional Stop raising UserWarning if .env file isn't found
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.