Skip to content

Conversation

@CyanVoxel
Copy link
Member

Summary

A version of #1067 that addresses the same Pyright issues in src/tagstudio/core/library/alchemy/, minus the large refactoring due to the reportImportCycles error.

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

@CyanVoxel CyanVoxel added this to the Alpha v9.5.6 milestone Sep 6, 2025
@CyanVoxel CyanVoxel added Type: Refactor Code that needs to be restructured or cleaned up TagStudio: Library Relating to the TagStudio library system labels Sep 6, 2025
@CyanVoxel CyanVoxel added Priority: High An important issue requiring attention Status: Review Needed A review of this is needed TagStudio: Search The TagStudio search engine labels Sep 6, 2025
@CyanVoxel CyanVoxel moved this to 🏓 Ready for Review in TagStudio Development Sep 6, 2025
Comment on lines 172 to 173
case _:
pass
Copy link
Collaborator

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

Copy link
Member Author

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 constraint

Copy link
Member Author

@CyanVoxel CyanVoxel Sep 6, 2025

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

@Computerdores Computerdores moved this from 🏓 Ready for Review to 🍃 Pending Merge in TagStudio Development Sep 6, 2025
@CyanVoxel CyanVoxel removed the Status: Review Needed A review of this is needed label Sep 6, 2025
@CyanVoxel CyanVoxel modified the milestones: Alpha v9.5.6, Alpha v9.5.5 Sep 6, 2025
@CyanVoxel CyanVoxel merged commit cee64a8 into main Sep 6, 2025
10 checks passed
@github-project-automation github-project-automation bot moved this from 🍃 Pending Merge to ✅ Done in TagStudio Development Sep 6, 2025
@CyanVoxel CyanVoxel deleted the pyright-alchemy-lite branch September 6, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: High An important issue requiring attention TagStudio: Library Relating to the TagStudio library system TagStudio: Search The TagStudio search engine Type: Refactor Code that needs to be restructured or cleaned up

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants