MCPcopy Create free account
hub / github.com/apache/arrow / _deprecate_class

Function _deprecate_class

python/pyarrow/util.py:109–123  ·  view source on GitHub ↗

Raise warning if a deprecated class is used in an isinstance check.

(old_name, new_class, next_version,
                     instancecheck=True)

Source from the content-addressed store, hash-verified

107
108
109def _deprecate_class(old_name, new_class, next_version,
110 instancecheck=True):
111 """
112 Raise warning if a deprecated class is used in an isinstance check.
113 """
114 class _DeprecatedMeta(type):
115 def __instancecheck__(self, other):
116 warnings.warn(
117 _DEPR_MSG.format(old_name, next_version, new_class.__name__),
118 FutureWarning,
119 stacklevel=2
120 )
121 return isinstance(other, new_class)
122
123 return _DeprecatedMeta(old_name, (new_class,), {})
124
125
126def _is_iterable(obj):

Callers

nothing calls this directly

Calls 1

_DeprecatedMetaClass · 0.85

Tested by

no test coverage detected