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

Feature/schema-env-processors-fix #39

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jdockerty
Copy link

This change enables a user to utilise a preprocessor or a postprocessor with the schema syntax. E.g.

test_env = Env(TEST=dict(cast=str, preprocessor=lambda v: v.upper()))

Prior to this, the pre/post processors would not fire, as they were not checked within the schema value. As such, the above code would show that the value of test_env('TEST') was hello, rather than HELLO if the processor had been applied. With this small addition, they now fire and work as I expected them too. I have added the accompanying tests too.

I hope this makes sense, feel free to make any alterations or comments as required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant