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

New MaxValueValidator on NumberFilter triggers Decimal FloatOperation trap #1275

Open
wearebasti opened this issue Sep 29, 2020 · 0 comments

Comments

@wearebasti
Copy link

The in 2.4.0 introduced MaxValueValidator sets as default 1e50 leading to have a float as max value, but the NumberFilter uses a DecimalField as base leading to FloatOperation exceptions if the corresponding trap is activated on the Decimal context. (https://docs.python.org/3/library/decimal.html#decimal.FloatOperation)

This is not visible for most people, I guess - we've it on in our test/dev-setup to not mix Floats and Decimals. I assume the max-value should either be a Decimal itself? (or a int(1e50) would probably suffice already.

In [2]: type(1e50)
Out[2]: float
@wearebasti wearebasti changed the title New MaxValueValidator on NumberFilter breaks decimal logic New MaxValueValidator on NumberFilter triggers Decimal FloatOperation trap Sep 29, 2020
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

No branches or pull requests

1 participant