-
-
Notifications
You must be signed in to change notification settings - Fork 419
refactor: fix most pyright issues in library/alchemy/
#1103
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
Conversation
| case _: | ||
| pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would throw an exception here instead since an unhandled Constraint would lead to an incorrect query and no ConstraintType should ever be unhandled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, that makes sense - however... I'm now realizing that there are 9 of our test cases failing due to falling under this case:
FAILED tests/test_search.py::test_and[orange and filetype:png-5] - NotImplementedError: Unhandled constraint
FAILED tests/test_search.py::test_and[square and filetype:jpg-2] - NotImplementedError: Unhandled constraint
FAILED tests/test_search.py::test_and[orange filetype:png-5] - NotImplementedError: Unhandled constraint
FAILED tests/test_search.py::test_and[green path:*inherit*-4] - NotImplementedError: Unhandled constraint
FAILED tests/test_search.py::test_or[filetype:jpg or tag:orange-11] - NotImplementedError: Unhandled constraint
FAILED tests/test_search.py::test_or[red or filetype:png-28] - NotImplementedError: Unhandled constraint
FAILED tests/test_search.py::test_or[filetype:jpg or path:*comp*-11] - NotImplementedError: Unhandled constraint
FAILED tests/test_search.py::test_not[special:untagged or not filetype:jpg-26] - NotImplementedError: Unhandled constraint
FAILED tests/test_search.py::test_parentheses[filetype:png and (tag:square or green)-12] - NotImplementedError: Unhandled constraintThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing slightly some more digging and this appears to be for the cases of ConstraintType.FileType, ConstraintType.Path, and one ConstraintType.Special. I think I could just add those into the switch and give them passes? Since that was effectively the behavior before, and an exception will still be raised for anything new or unexpected coming through
Summary
A version of #1067 that addresses the same Pyright issues in
src/tagstudio/core/library/alchemy/, minus the large refactoring due to thereportImportCycleserror.Tasks Completed