Skip to content

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