Remove lt and gt as cog.Input options - #448
Conversation
…kes them unusable Signed-off-by: Dashiell Stander <dstander@protonmail.com>
Signed-off-by: Dashiell Stander <dstander@protonmail.com>
c64f2af to
fc44382
Compare
zeke
left a comment
There was a problem hiding this comment.
Ooh tricky. Nice fix.
Looks like the ge and le options are somehow NOT impacted that FastAPI bug uriyyo/fastapi-pagination#148 🤷🏼
| def test_gt_lt(): | ||
| class Predictor(BasePredictor): | ||
| def predict(self, num: float = Input(gt=3, lt=10.5)) -> float: | ||
| def predict(self, num: float = Input(ge=3.01, le=10.5)) -> float: |
There was a problem hiding this comment.
For some reason I thought it was important to maintain the test's original restrictions on having the value be greater-than-but-not-equal-to 3. But then after I had done all that I noticed that the actual test value that's passed through is 5 so.... yeah, it could just remain 3. Whatever you wanna do
|
Another IRL conversation that @dashstander and I had briefly: Not essential for this PR if we want to do that -- we can fix in a follow-up one. |
|
@all-contributors please add @dashstander for bugs, code, and tests |
|
I've put up a pull request to add @dashstander! 🎉 |
* Removed gt and lt cog.Input options because of a pydantic bug that makes them unusable Signed-off-by: Dashiell Stander <dstander@protonmail.com> * Removed references to gt and lt from documentation Signed-off-by: Dashiell Stander <dstander@protonmail.com>
* Removed gt and lt cog.Input options because of a pydantic bug that makes them unusable Signed-off-by: Dashiell Stander <dstander@protonmail.com> * Removed references to gt and lt from documentation Signed-off-by: Dashiell Stander <dstander@protonmail.com>
Due to this pydantic bug, the
gtandltoptions forcog.Inputdo not work and cause the schema parsing to fail. This PR removes them and fixes the tests / documentation to not use them.