From 6c4b3e7d59613bef4be32313850da5ab7eacc095 Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Thu, 21 Aug 2025 15:11:50 +1000 Subject: [PATCH 1/4] added staticmethod to functools.partial --- src/azure-cli-core/azure/cli/core/aaz/_command.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/azure-cli-core/azure/cli/core/aaz/_command.py b/src/azure-cli-core/azure/cli/core/aaz/_command.py index 9c9105b8ada..c9ed613e64d 100644 --- a/src/azure-cli-core/azure/cli/core/aaz/_command.py +++ b/src/azure-cli-core/azure/cli/core/aaz/_command.py @@ -327,12 +327,12 @@ def decorator(cls): helps[name] = yaml.safe_dump(cls.AZ_HELP) if is_preview: - cls.AZ_PREVIEW_INFO = partial(PreviewItem, target=f'az {name}', object_type='command group') + cls.AZ_PREVIEW_INFO = staticmethod(partial(PreviewItem, target=f'az {name}', object_type='command group')) if is_experimental: - cls.AZ_EXPERIMENTAL_INFO = partial(ExperimentalItem, target=f'az {name}', object_type='command group') + cls.AZ_EXPERIMENTAL_INFO = staticmethod(partial(ExperimentalItem, target=f'az {name}', object_type='command group')) if deprecated_info: - cls.AZ_DEPRECATE_INFO = partial(Deprecated, target=f'az {name}', object_type='command group', - **deprecated_info) + cls.AZ_DEPRECATE_INFO = staticmethod(partial(Deprecated, target=f'az {name}', object_type='command group', + **deprecated_info)) return cls return decorator @@ -369,11 +369,11 @@ def decorator(cls): if confirmation: cls.AZ_CONFIRMATION = confirmation if is_preview: - cls.AZ_PREVIEW_INFO = partial(PreviewItem, target=f'az {name}', object_type='command') + cls.AZ_PREVIEW_INFO = staticmethod(partial(PreviewItem, target=f'az {name}', object_type='command')) if is_experimental: - cls.AZ_EXPERIMENTAL_INFO = partial(ExperimentalItem, target=f'az {name}', object_type='command') + cls.AZ_EXPERIMENTAL_INFO = staticmethod(partial(ExperimentalItem, target=f'az {name}', object_type='command')) if deprecated_info: - cls.AZ_DEPRECATE_INFO = partial(Deprecated, target=f'az {name}', object_type='command', **deprecated_info) + cls.AZ_DEPRECATE_INFO = staticmethod(partial(Deprecated, target=f'az {name}', object_type='command', **deprecated_info)) return cls return decorator From 60092c7f4157649f855327445bccd7621ce8be54 Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Mon, 25 Aug 2025 13:33:12 +1000 Subject: [PATCH 2/4] Update src/azure-cli-core/azure/cli/core/aaz/_command.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/azure-cli-core/azure/cli/core/aaz/_command.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/azure-cli-core/azure/cli/core/aaz/_command.py b/src/azure-cli-core/azure/cli/core/aaz/_command.py index c9ed613e64d..5aa5b92cc81 100644 --- a/src/azure-cli-core/azure/cli/core/aaz/_command.py +++ b/src/azure-cli-core/azure/cli/core/aaz/_command.py @@ -332,7 +332,7 @@ def decorator(cls): cls.AZ_EXPERIMENTAL_INFO = staticmethod(partial(ExperimentalItem, target=f'az {name}', object_type='command group')) if deprecated_info: cls.AZ_DEPRECATE_INFO = staticmethod(partial(Deprecated, target=f'az {name}', object_type='command group', - **deprecated_info)) + **deprecated_info)) return cls return decorator From 38dcc9dc919fd5314b228e082f22b7ad7e68ca0c Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Tue, 26 Aug 2025 03:52:28 +0000 Subject: [PATCH 3/4] addressing line too long lint error --- src/azure-cli-core/azure/cli/core/aaz/_command.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/azure-cli-core/azure/cli/core/aaz/_command.py b/src/azure-cli-core/azure/cli/core/aaz/_command.py index 5aa5b92cc81..eff2efdbc52 100644 --- a/src/azure-cli-core/azure/cli/core/aaz/_command.py +++ b/src/azure-cli-core/azure/cli/core/aaz/_command.py @@ -327,11 +327,14 @@ def decorator(cls): helps[name] = yaml.safe_dump(cls.AZ_HELP) if is_preview: - cls.AZ_PREVIEW_INFO = staticmethod(partial(PreviewItem, target=f'az {name}', object_type='command group')) + cls.AZ_PREVIEW_INFO = staticmethod(partial(PreviewItem, + target=f'az {name}', object_type='command group')) if is_experimental: - cls.AZ_EXPERIMENTAL_INFO = staticmethod(partial(ExperimentalItem, target=f'az {name}', object_type='command group')) + cls.AZ_EXPERIMENTAL_INFO = staticmethod(partial(ExperimentalItem, + target=f'az {name}', object_type='command group')) if deprecated_info: - cls.AZ_DEPRECATE_INFO = staticmethod(partial(Deprecated, target=f'az {name}', object_type='command group', + cls.AZ_DEPRECATE_INFO = staticmethod(partial(Deprecated, + target=f'az {name}', object_type='command group', **deprecated_info)) return cls @@ -371,9 +374,11 @@ def decorator(cls): if is_preview: cls.AZ_PREVIEW_INFO = staticmethod(partial(PreviewItem, target=f'az {name}', object_type='command')) if is_experimental: - cls.AZ_EXPERIMENTAL_INFO = staticmethod(partial(ExperimentalItem, target=f'az {name}', object_type='command')) + cls.AZ_EXPERIMENTAL_INFO = staticmethod(partial(ExperimentalItem, + target=f'az {name}', object_type='command')) if deprecated_info: - cls.AZ_DEPRECATE_INFO = staticmethod(partial(Deprecated, target=f'az {name}', object_type='command', **deprecated_info)) + cls.AZ_DEPRECATE_INFO = staticmethod(partial(Deprecated, target=f'az {name}', + object_type='command', **deprecated_info)) return cls return decorator From 60d1b56d85f375913f02412368fc9ef81a1a7f7a Mon Sep 17 00:00:00 2001 From: Ren Silva Date: Tue, 26 Aug 2025 04:27:28 +0000 Subject: [PATCH 4/4] addressing trailing whitespaces lint error --- src/azure-cli-core/azure/cli/core/aaz/_command.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/azure-cli-core/azure/cli/core/aaz/_command.py b/src/azure-cli-core/azure/cli/core/aaz/_command.py index eff2efdbc52..577d8a7cf45 100644 --- a/src/azure-cli-core/azure/cli/core/aaz/_command.py +++ b/src/azure-cli-core/azure/cli/core/aaz/_command.py @@ -327,13 +327,13 @@ def decorator(cls): helps[name] = yaml.safe_dump(cls.AZ_HELP) if is_preview: - cls.AZ_PREVIEW_INFO = staticmethod(partial(PreviewItem, + cls.AZ_PREVIEW_INFO = staticmethod(partial(PreviewItem, target=f'az {name}', object_type='command group')) if is_experimental: - cls.AZ_EXPERIMENTAL_INFO = staticmethod(partial(ExperimentalItem, + cls.AZ_EXPERIMENTAL_INFO = staticmethod(partial(ExperimentalItem, target=f'az {name}', object_type='command group')) if deprecated_info: - cls.AZ_DEPRECATE_INFO = staticmethod(partial(Deprecated, + cls.AZ_DEPRECATE_INFO = staticmethod(partial(Deprecated, target=f'az {name}', object_type='command group', **deprecated_info)) return cls @@ -374,10 +374,10 @@ def decorator(cls): if is_preview: cls.AZ_PREVIEW_INFO = staticmethod(partial(PreviewItem, target=f'az {name}', object_type='command')) if is_experimental: - cls.AZ_EXPERIMENTAL_INFO = staticmethod(partial(ExperimentalItem, + cls.AZ_EXPERIMENTAL_INFO = staticmethod(partial(ExperimentalItem, target=f'az {name}', object_type='command')) if deprecated_info: - cls.AZ_DEPRECATE_INFO = staticmethod(partial(Deprecated, target=f'az {name}', + cls.AZ_DEPRECATE_INFO = staticmethod(partial(Deprecated, target=f'az {name}', object_type='command', **deprecated_info)) return cls