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

Attributes: Greater than (gt) does not work #220

Open
Innders opened this issue Jun 3, 2024 · 4 comments
Open

Attributes: Greater than (gt) does not work #220

Innders opened this issue Jun 3, 2024 · 4 comments
Assignees

Comments

@Innders
Copy link
Member

Innders commented Jun 3, 2024

To reproduce

Steps to reproduce the behavior:

  1. Go to /settings/attributes
  2. Edit or create new attribute
  3. Set gt value to 0 or 0.5.
  4. Do not set ge

Expected behavior

When setting the value in the scope, anything below or equal to gt should throw an error.
ge, lt, le seem to work.

Discovered whilst doing Attributes: Min and max values

@Innders Innders added the type: bug Something isn't working label Jun 3, 2024
@martastain
Copy link
Member

I was not able to reproduce it. It seems to work alright (apart from the fact the error message should be friendlier).

BTW GT/GTE switch in the attribute editor is not available for integers? only for decimals?

image

@BigRoy
Copy link
Contributor

BigRoy commented Jun 10, 2024

BTW GT/GTE switch in the attribute editor is not available for integers? only for decimals?

I believe that's correct looking at @Innders 's answer here.

@Innders
Copy link
Member Author

Innders commented Jun 10, 2024

On experimental, setting -1 on pizzaShare won't throw an error.

(Just realised this is GE, but that still doesn't work)

image
image

image

@martastain
Copy link
Member

Interesting. You are not sending a number, but a string. My wild guess is that implicit type conversions somehow mess with the validation. Normally this should return a type error as "-1" is not a value that could be compared to a number. but Pydantic apparently tries to do some type casting there and fails.

@martastain martastain removed the type: bug Something isn't working label Nov 6, 2024
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

3 participants