MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / warned

Function warned

lib/sqlalchemy/util/deprecations.py:250–281  ·  view source on GitHub ↗
(fn: _F, *args: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

248 # Concatenate or something
249 @decorator
250 def warned(fn: _F, *args: Any, **kwargs: Any) -> _F:
251 for m in check_defaults:
252 if (defaults[m] is None and kwargs[m] is not None) or (
253 defaults[m] is not None and kwargs[m] != defaults[m]
254 ):
255 _warn_with_version(
256 messages[m],
257 versions[m],
258 version_warnings[m],
259 stacklevel=3,
260 )
261
262 if check_any_kw in messages and set(kwargs).difference(
263 check_defaults
264 ):
265 assert check_any_kw is not None
266 _warn_with_version(
267 messages[check_any_kw],
268 versions[check_any_kw],
269 version_warnings[check_any_kw],
270 stacklevel=3,
271 )
272
273 for m in check_kw:
274 if m in kwargs:
275 _warn_with_version(
276 messages[m],
277 versions[m],
278 version_warnings[m],
279 stacklevel=3,
280 )
281 return fn(*args, **kwargs) # type: ignore[no-any-return]
282
283 doc = fn.__doc__ if fn.__doc__ is not None else ""
284 if doc:

Callers 2

decorateFunction · 0.85
_decorate_with_warningFunction · 0.85

Calls 3

_warn_with_versionFunction · 0.85
differenceMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected