From 8365987994394fc898be06d1d5da993a061f9d2b Mon Sep 17 00:00:00 2001 From: Deepyaman Datta Date: Wed, 21 Jun 2023 01:18:02 -0400 Subject: [PATCH] Quote class names in `DeprecationWarning` messages (#2706) --- kedro/utils.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kedro/utils.py b/kedro/utils.py index 7da9e3c419..380372853c 100644 --- a/kedro/utils.py +++ b/kedro/utils.py @@ -45,8 +45,9 @@ def new(mcs, *args, **kwargs): if alias is not None: warn( - f"{mcs.__name__} has been renamed to {alias.__name__}, and the " - f"alias will be removed in Kedro 0.19.0", + f"{repr(mcs.__name__)} has been renamed to " + f"{repr(alias.__name__)}, and the alias will " + f"be removed in Kedro 0.19.0", DeprecationWarning, stacklevel=2, ) @@ -63,8 +64,9 @@ def new(mcs, *args, **kwargs): if alias is not None: warn( - f"{base.__name__} has been renamed to {alias.__name__}, and the " - f"alias will be removed in Kedro 0.19.0", + f"{repr(base.__name__)} has been renamed to " + f"{repr(alias.__name__)}, and the alias will be " + f"removed in Kedro 0.19.0", DeprecationWarning, stacklevel=2, )