From 2432d2ed0b28480c0e1004a47aa74238865105b5 Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Mon, 27 Sep 2021 12:51:32 -0400 Subject: Fixes: #4390 Deprecated an undocumented loader option syntax ``".*"``, which appears to be no different than passing a single asterisk, and will emit a deprecation warning if used. This syntax may have been intended for something but there is currently no need for it. The original ticket was to document the `.{WILDCARD}` (e.g. `.*`) format, however this format does not appear to be used or needed by SQLAlchemy and is likely not used by any projects or developers. This PR invokes `util.warn_deprecated` to notify users this functionality is deprecated, and directs them to the #4390 issue if they actually use it. Assuming there are no complaints over this warning in the coming months, this code can be removed in a future major release. Change-Id: I665e3ac26be0a7819246a2ee56fb5a5f32980c91 --- lib/sqlalchemy/orm/strategy_options.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/sqlalchemy') diff --git a/lib/sqlalchemy/orm/strategy_options.py b/lib/sqlalchemy/orm/strategy_options.py index 675c7218b..30286c1d8 100644 --- a/lib/sqlalchemy/orm/strategy_options.py +++ b/lib/sqlalchemy/orm/strategy_options.py @@ -919,6 +919,15 @@ class _UnboundLoad(Load): return (_DEFAULT_TOKEN,) # coerce fooload(".*") into "wildcard on default entity" elif key.startswith("." + _WILDCARD_TOKEN): + util.warn_deprecated( + "The undocumented `.{WILDCARD}` format is deprecated " + "and will be removed in a future version as it is " + "believed to be unused. " + "If you have been using this functionality, please " + "comment on Issue #4390 on the SQLAlchemy project " + "tracker.", + version="1.4", + ) key = key[1:] return key.split(".") else: -- cgit v1.2.1