79761994

Date: 2025-09-11 13:44:47
Score: 0.5
Natty:
Report link

It seems that even in recent versions the order matters. The first code shows type warnings in PyCharm 2025.1.3, Python 3.13, SQLAlchemy==2.0.43, the second doesn't:

.filter(MusicLibrary.id == request.id)
.filter(request.id == MusicLibrary.id)

There was an issue with PyCharm that is closed now: https://github.com/sqlalchemy/sqlalchemy/issues/9337 `Pycharm fixed it at 2024.2.2` (posted 2024-10-16)

As I can see in the question asked by Vic the comparison also was "table object.table field" compared to "simple type":

.where(Albums.Id > user_last_sync_id)

I guess that just flipping the comparison fixes the type warnings.

Please correct me if I'm wrong.

Cheers

Reasons:
  • Blacklisted phrase (1): Cheers
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: DwightKendall