sqlalchemy2-stubs icon indicating copy to clipboard operation
sqlalchemy2-stubs copied to clipboard

consider a function-layer in the ORM that returns "Any"

Open zzzeek opened this issue 4 years ago • 0 comments

all ORM functions that are used in declarative are now made separate from the classes they refer towards in all cases and indicate the return type of Any so they can be used inline with Mapped[_T] in declarative mappings such that IDEs can deliver Mapped[] behavior without any linter errors.

this will require changes in the mypy plugin as we can no longer rely on simple things like "composite()" returning CompositeProperty.

References: https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/3074

Fixes: #170

Description

Checklist

This pull request is:

  • [ ] A documentation / typographical error fix
    • Good to go, no issue or tests are needed
  • [ ] 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!

zzzeek avatar Sep 09 '21 21:09 zzzeek