]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fixes: #4556 - Test that prevents passing a filter to Session.query when running...
authorramonvg <ramonvillalongaa@gmail.com>
Wed, 24 Jun 2020 13:51:56 +0000 (09:51 -0400)
committerGord Thompson <gord@gordthompson.com>
Wed, 24 Jun 2020 18:53:59 +0000 (12:53 -0600)
commit0fd256d9937222ddf9f9d138641a59247ce0d450
treea44996e422586c49695395ce31522a2035a8a333
parent660a340bff8fcefd2826032e75210c0924a2335e
Fixes: #4556 - Test that prevents passing a filter to Session.query when running an update
### Description
There was a bug in 1.3.8 that allowed passing a `BinaryExpression` to `Session().query`. I assume it was fixed in https://github.com/sqlalchemy/sqlalchemy/commit/3ab2364e78641c4f0e4b6456afc2cbed39b0d0e6 since now it raises:
```
sqlalchemy.exc.ArgumentError: subject table for an INSERT, UPDATE or DELETE expected, got <sqlalchemy.sql.elements.BinaryExpression object at 0x7f3d90426370>.
```

I'm just adding a test that ensures the behavior. Fixes: [4556](https://github.com/sqlalchemy/sqlalchemy/issues/4556)

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #5419
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5419
Pull-request-sha: af7601dff1a0dce94802627a9fe2398be60d8186

Change-Id: Ic1a9075e7e8520510964fdd3d7ac14fba550110c
test/orm/test_update_delete.py