-
-
Notifications
You must be signed in to change notification settings - Fork 671
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
Proper handling of None in WHERE condition #109
Comments
I believe this is concerned entirely with SQLAlchemy, not with SQLModel, and has to do with the required semantics to construct a
From a cursory search, it does not seem that the |
@mmlynarik Along the lines of |
If it worked as expected, then definitely yes:) |
Ok, I am working on a PR implementing this, repo owners please give me some time 👍 |
You can use |
@tc-imba where to import |
|
My understanding is this:
But |
For
|
The same goes for the select(Ticket).where(Ticket.stage_id.in_(stage_ids)) This also let mypy and other type using tool cry out loud like |
I guess the issue title could be updated to smth like |
looking for a team without heros like
isn't compatible with E711 but doesn't work |
In the end, write the code that works for you. PEP 8 is just a recommendation, and flake8 is just a tool. If you prefer to ignore a recommendation, PEP 8 has a section about that as well. |
Besides using |
@patrickwasp this issue is still open. It hasn't be merged to the code base yet. I recommend the following code:
|
First Check
Commit to Help
Example Code
Description
To make the where condition
Hero.age is None
functional, because currently it is evaluated as false even though it should be true. Otherwise, one needs to useHero.age == None
, which raises linting error.Wanted Solution
To make the where condition
Hero.age is None
functional, because currently it is evaluated as false even though it should be true. Otherwise, one needs to useHero.age == None
, which raises linting error.Wanted Code
Alternatives
No response
Operating System
Linux
Operating System Details
No response
SQLModel Version
0.0.4
Python Version
3.8.5
Additional Context
No response
The text was updated successfully, but these errors were encountered: