]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Support `TypeDecorator` subclasses in `Column()` declarations
authorBryan Forbes <bryan@reigndropsfall.net>
Thu, 8 Apr 2021 16:27:17 +0000 (12:27 -0400)
committersqla-tester <sqla-tester@sqlalchemy.org>
Thu, 8 Apr 2021 16:27:17 +0000 (12:27 -0400)
commitce6f8ec5f5b76267e75b63827142ceda2276d918
tree1448db42b2b16ca94e9497cbdf92b5105e419d44
parent58c02c23aeee10442e6376330d5efcc8eb5832b5
Support `TypeDecorator` subclasses in `Column()` declarations

<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
Currently, the plugin resolves `TypeDecorator` subclasses in `Column()` declarations to `Mapping[_T]` instead of the correct type in the class declaration.

### 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: #6223
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6223
Pull-request-sha: 5136bc4b6333e868cc47f1b2dcc58716a40cadca

Change-Id: Idc865bf7320f8ea3054c28dea095b693fe112753
doc/build/changelog/unreleased_14/mypy_typedec.rst [new file with mode: 0644]
lib/sqlalchemy/ext/mypy/infer.py
test/ext/mypy/files/type_decorator.py [new file with mode: 0644]