Move Operator.is_ and Operator.is_not to OperatorClass.BASE
Operator.is_ and Operator.is_not seem to be part of OperatorClass.COMPARISON. which is not part of HSTORE because you can't say hstore_col > value.
I think it's by definition that no datatype in SQL can't be in a NULL column, so this suggests that Operator.is_ and Operator.is_not should be part of OperatorClass.BASE and not OperatorClass.COMPARISON.
so a bigger-scoped change. (it's all just "do we warn or not" in the end though, it shouldn't cause a problem)
Originally posted by @zzzeek in https://github.com/sqlalchemy/sqlalchemy/discussions/13712#discussioncomment-19123424
sort of a regression too right
Yeah probably, but I think it's mainly in exotic types that's include comparison as op class. Most types should not be impacted
Would you accept an AI-assisted patch moving is_ and is_not to OperatorClass.BASE? It includes regression tests for HSTORE and a BASE-only type: four cases fail before the fix and pass afterward, while unsupported ordering still warns.
If that scope is suitable, could you add the “open for pull requests” label?
I think it's best of it's done internally @OllieinCanada, thanks
@CaselIT Thanks for clarifying; I'll leave #13719 to the team. Are there other SQLAlchemy tasks where you'd welcome outside help, particularly regression tests, bug reproduction, or maintenance work? I use AI assistance and would follow the project's contribution requirements. I'd appreciate a pointer to something useful to the team.
@zzzeek I think some bigger changes are needed:
- is_distinct_from/is_not_distinct_from are likely also base.
- we may want to split eq/ne/in_ etc from the other comparison ones. For example HSOTRE supports = and in but not <
Maybe a new EQUALITY class?
Federico Caselli has proposed a fix for this issue in the main branch:
don't treat is_ / is_not as COMPARISON operators https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/7128
sure if it doesnt look awful
Hey, just updated to 2.1.7, can confirm my original issue is fixed, thanks!
But I now hit the same issue with is_distinct_from/is_not_distinct_from, as you suspected @CaselIT.
(nothing blocking, I'll just ignore the warning for now!)
[edit] also have issues with some == usages, which are valid operations for HSTORE: would they be included in the EQUALITY class you mentioned?
I've tried to improve things a bit here https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/7175