ynput / ayon-backend

Server codebase with API access to AYON
Apache License 2.0
18 stars 14 forks source link

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

Open Innders opened 1 month ago

Innders commented 1 month ago

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

martastain commented 1 month ago

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 commented 1 month ago

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 commented 4 weeks ago

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 commented 4 weeks ago

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.