Skip to content

DeprecatedWarningDict not printing the replacement #4706

@zhongsanming

Description

@zhongsanming

Bug Report

Describe the bug

onnx/onnx/mapping.py

Lines 86 to 105 in 45f508b

def __getitem__(self, key: Union[int, str, np.dtype]) -> Any:
if not self._future_function:
warnings.warn(
str(
f"`mapping.{self._origin_function}` is now deprecated and will be removed in the next release or so."
+ "To silence this warning, please simply use if-else statement to get the corresponding value."
),
DeprecationWarning,
stacklevel=2,
)
else:
warnings.warn(
str(
f"`mapping.{self._origin_function}` is now deprecated and will be removed in the next release or so."
+ "To silence this warning, please use `helper.{self._future_function}` instead."
),
DeprecationWarning,
stacklevel=2,
)
return super().__getitem__(key)

in line 100, the string should be a f-string

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions