]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
pep-484: ORM public API, constructors
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 15 Apr 2022 15:05:36 +0000 (11:05 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 20 Apr 2022 19:14:09 +0000 (15:14 -0400)
commitaeeff72e806420bf85e2e6723b1f941df38a3e1a
tree0bed521b4d7c4860f998e51ba5e318d18b2f5900
parent13a8552053c21a9fa7ff6f992ed49ee92cca73e4
pep-484: ORM public API, constructors

for the moment, abandoning using @overload with
relationship() and mapped_column().  The overloads
are very difficult to get working at all, and
the overloads that were there all wouldn't pass on
mypy.  various techniques of getting them to
"work", meaning having right hand side dictate
what's legal on the left, have mixed success
and wont give consistent results; additionally,
it's legal to have Optional / non-optional
independent of nullable in any case for columns.
relationship cases are less ambiguous but mypy
was not going along with things.

we have a comprehensive system of allowing
left side annotations to drive the right side,
in the absense of explicit settings on the right.
so type-centric SQLAlchemy will be left-side
driven just like dataclasses, and the various flags
and switches on the right side will just not be
needed very much.

in other matters, one surprise, forgot to remove string support
from orm.join(A, B, "somename") or do deprecations
for it in 1.4.   This is a really not-directly-used
structure barely
mentioned in the docs for many years, the example
shows a relationship being used, not a string, so
we will just change it to raise the usual error here.

Change-Id: Iefbbb8d34548b538023890ab8b7c9a5d9496ec6e
68 files changed:
lib/sqlalchemy/engine/cursor.py
lib/sqlalchemy/engine/util.py
lib/sqlalchemy/ext/asyncio/scoping.py
lib/sqlalchemy/ext/hybrid.py
lib/sqlalchemy/ext/instrumentation.py
lib/sqlalchemy/inspection.py
lib/sqlalchemy/orm/_orm_constructors.py
lib/sqlalchemy/orm/_typing.py
lib/sqlalchemy/orm/attributes.py
lib/sqlalchemy/orm/base.py
lib/sqlalchemy/orm/context.py
lib/sqlalchemy/orm/decl_api.py
lib/sqlalchemy/orm/decl_base.py
lib/sqlalchemy/orm/descriptor_props.py
lib/sqlalchemy/orm/events.py
lib/sqlalchemy/orm/exc.py
lib/sqlalchemy/orm/instrumentation.py
lib/sqlalchemy/orm/interfaces.py
lib/sqlalchemy/orm/loading.py
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/path_registry.py
lib/sqlalchemy/orm/properties.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/relationships.py
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/sql/_elements_constructors.py
lib/sqlalchemy/sql/_typing.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/coercions.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/ddl.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/lambdas.py
lib/sqlalchemy/sql/roles.py
lib/sqlalchemy/sql/schema.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/util.py
lib/sqlalchemy/sql/visitors.py
lib/sqlalchemy/testing/plugin/plugin_base.py
lib/sqlalchemy/util/_collections.py
lib/sqlalchemy/util/_py_collections.py
lib/sqlalchemy/util/deprecations.py
lib/sqlalchemy/util/langhelpers.py
lib/sqlalchemy/util/preloaded.py
lib/sqlalchemy/util/typing.py
pyproject.toml
test/ext/mypy/plain_files/association_proxy_one.py
test/ext/mypy/plain_files/experimental_relationship.py
test/ext/mypy/plain_files/hybrid_one.py
test/ext/mypy/plain_files/hybrid_two.py
test/ext/mypy/plain_files/mapped_column.py
test/ext/mypy/plain_files/sql_operations.py
test/ext/mypy/plain_files/trad_relationship_uselist.py
test/ext/mypy/plain_files/traditional_relationship.py
test/ext/mypy/plugin_files/relationship_6255_one.py
test/ext/mypy/plugin_files/typing_err3.py
test/ext/test_extendedattr.py
test/orm/inheritance/test_basic.py
test/orm/test_cascade.py
test/orm/test_instrumentation.py
test/orm/test_joins.py
test/orm/test_mapper.py
test/orm/test_options.py
test/orm/test_query.py
test/orm/test_utils.py
test/sql/test_selectable.py