2525RATE_LIMIT = 4
2626RATE_LIMIT_PERIOD = 1
2727
28+ # Import lightweight constants at module level for test compatibility
29+ from sagemaker .hyperpod .cli .constants .command_constants import (
30+ DEEP_HEALTH_CHECK_STATUS_LABEL ,
31+ HP_HEALTH_STATUS_LABEL ,
32+ INSTANCE_TYPE_LABEL ,
33+ )
34+
35+ # Import lightweight ClusterValidator for test compatibility
36+ from sagemaker .hyperpod .cli .validators .cluster_validator import ClusterValidator
37+
2838def _ensure_cluster_deps ():
2939 """Lazy load heavy dependencies for cluster commands"""
3040 global logging , subprocess , json , sys , botocore , defaultdict
@@ -36,7 +46,7 @@ def _ensure_cluster_deps():
3646 global TOTAL_ACCELERATOR_DEVICES_KEY , TEMP_KUBE_CONFIG_FILE , OutputFormat
3747 global get_user_agent_extra_suffix , ListPods , get_name_from_arn
3848 global get_sagemaker_client , setup_logger , set_logging_level
39- global store_current_hyperpod_context , ClusterValidator , get_eks_cluster_name
49+ global store_current_hyperpod_context , get_eks_cluster_name
4050 global get_cluster_context_util , get_monitoring_config , is_observability_addon_enabled
4151 global _hyperpod_telemetry_emitter , Feature , RATE_LIMIT , RATE_LIMIT_PERIOD , logger
4252
@@ -66,7 +76,7 @@ def _ensure_cluster_deps():
6676 get_name_from_arn , get_sagemaker_client , setup_logger , set_logging_level ,
6777 store_current_hyperpod_context , get_eks_cluster_name ,
6878 )
69- from sagemaker . hyperpod . cli . validators . cluster_validator import ClusterValidator
79+ # ClusterValidator already imported at module level, no need to reimport
7080 from sagemaker .hyperpod .common .utils import get_cluster_context as get_cluster_context_util
7181 from sagemaker .hyperpod .observability .utils import get_monitoring_config , is_observability_addon_enabled
7282 from sagemaker .hyperpod .common .telemetry .telemetry_logging import _hyperpod_telemetry_emitter
0 commit comments