boundless-author-34124
02/21/2026, 11:11 PMvalidate_kube_labels looks like the function isn't raising KubernetesException at the right level. Is this a known issue or worth a PR?glamorous-easter-37147
02/21/2026, 11:35 PMglamorous-easter-37147
02/21/2026, 11:38 PMKubernetesException classes exist in the codebaseglamorous-easter-37147
02/21/2026, 11:43 PMboundless-author-34124
02/21/2026, 11:53 PMboundless-author-34124
02/21/2026, 11:53 PMglamorous-easter-37147
02/22/2026, 12:02 AMvalidate_kube_labels(labels)test/unit/test_kubernetes.py72 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ metaflow/plugins/kubernetes/kube_utils.py91 in validate_kube_labels return all([validate_label(v) for v in labels.values()]) if labels else True ^^^^^^^^^^^^^^^^^ def validate_label(s: Optional[str]): regex_match = r"^(([A-Za-z0-9][-A-Za-z0-9_.]{0,61})?[A-Za-z0-9])?$" if not s: # allow empty label return True if not re.search(regex_match, s):
raise KubernetesException('Invalid value: "%s"\n' "A valid label must be an empty string or one that\n" " - Consist of alphanumeric, '-', '_' or '.' characters\n" " - Begins and ends with an alphanumeric character\n" " - Is at most 63 characters" % s ) E metaflow.plugins.kubernetes.kube_utils.KubernetesException: Invalid value: "a-" E A valid label must be an empty string or one that E - Consist of alphanumeric, '-', '_' or '.' characters E - Begins and ends with an alphanumeric character E - Is at most 63 characters metaflow/plugins/kubernetes/kube_utils.py82 KubernetesException ============================================ warnings summary ============================================ .venv/lib/python3.13/site-packages/_yaml/__init__.py:18 /Users/luisgonzalez/Documents/code/metaflow_for_cloud_dev/metaflow/.venv/lib/python3.13/site-packages/_yaml/__init__.py18 DeprecationWarning: The _yaml extension module is now located at yaml._yaml and its location is subject to change. To use the LibYAML-based parser and emitter, import from `yaml`:
from yaml import CLoader as Loader, CDumper as Dumper.
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================== short test summary info =========================================
FAILED test/unit/test_kubernetes.py::test_kubernetes_decorator_validate_kube_labels_fail[labels0] - metaflow.plugins.kubernetes.kube_utils.KubernetesException: Invalid value: "a-"
====================================== 1 failed, 1 warning in 0.20s ======================================glamorous-easter-37147
02/22/2026, 12:05 AMboundless-author-34124
02/22/2026, 12:35 AMboundless-author-34124
02/22/2026, 12:42 AMglamorous-easter-37147
02/22/2026, 12:42 AM