From 348260943a52ddd7ee3388eaac8e05da3794958b Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 12 Oct 2020 15:17:25 -0400 Subject: Deprecate strings indicating attribute names Using strings to represent relationship names in ORM operations such as :meth:`_orm.Query.join`, as well as strings for all ORM attribute names in loader options like :func:`_orm.selectinload` is deprecated and will be removed in SQLAlchemy 2.0. The class-bound attribute should be passed instead. This provides much better specificity to the given method, allows for modifiers such as ``of_type()``, and reduces internal complexity. Additionally, the ``aliased`` and ``from_joinpoint`` parameters to :meth:`_orm.Query.join` are also deprecated. The :func:`_orm.aliased` construct now provides for a great deal of flexibility and capability and should be used directly. Fixes: #4705 Fixes: #5202 Change-Id: I32f61663d68026154906932913c288f269991adc --- lib/sqlalchemy/testing/warnings.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/sqlalchemy/testing') diff --git a/lib/sqlalchemy/testing/warnings.py b/lib/sqlalchemy/testing/warnings.py index 5704cf2a6..bed58f777 100644 --- a/lib/sqlalchemy/testing/warnings.py +++ b/lib/sqlalchemy/testing/warnings.py @@ -105,6 +105,17 @@ def setup_filters(): r"The Query\.with_parent\(\) function", r"The Query\.with_parent\(\) function", r"The Query\.select_entity_from\(\) function", + r"The ``aliased`` and ``from_joinpoint`` keyword arguments", + r"Using strings to indicate relationship names in Query.join", + r"Using strings to indicate column or relationship paths in " + "loader options", + r"Using strings to indicate relationship names in the ORM " + r"with_parent\(\)", + r"The Query.with_polymorphic\(\) function/method is considered " + "legacy as of the 1.x series", + r"Passing a chain of multiple join conditions to Query.join\(\) " + r"is deprecated and will be removed in SQLAlchemy 2.0.", + r"Query.join\(\) will no longer accept tuples as arguments", # # ORM Session # -- cgit v1.2.1