From 2dc9e5b306457dcc6b3bca26cdb3169c91bd1a61 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 01:21:34 +0000 Subject: [PATCH 1/2] Initial plan From 232515d0cba584910b418e311ee87f74b1937366 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Mar 2026 01:26:18 +0000 Subject: [PATCH 2/2] Add NULL_LABEL constant for Azure App Configuration Provider Co-authored-by: mrm9084 <1054559+mrm9084@users.noreply.github.com> --- .../azure-appconfiguration-provider/CHANGELOG.md | 2 ++ .../azure-appconfiguration-provider/README.md | 4 ++-- .../azure/appconfiguration/provider/__init__.py | 2 ++ .../azure/appconfiguration/provider/_constants.py | 8 ++++++++ .../tests/test_setting_selector.py | 9 +++++++++ 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/sdk/appconfiguration/azure-appconfiguration-provider/CHANGELOG.md b/sdk/appconfiguration/azure-appconfiguration-provider/CHANGELOG.md index 3175bb377923..b68b6e8ef884 100644 --- a/sdk/appconfiguration/azure-appconfiguration-provider/CHANGELOG.md +++ b/sdk/appconfiguration/azure-appconfiguration-provider/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Added `NULL_LABEL` constant for use with `SettingSelector` to represent configuration settings with no label assigned. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/appconfiguration/azure-appconfiguration-provider/README.md b/sdk/appconfiguration/azure-appconfiguration-provider/README.md index beef0a637f17..25ff4aa9a84b 100644 --- a/sdk/appconfiguration/azure-appconfiguration-provider/README.md +++ b/sdk/appconfiguration/azure-appconfiguration-provider/README.md @@ -63,10 +63,10 @@ List of features we are going to add to the Python Provider in the future. You can refine or expand the configurations loaded from your store by using `SettingSelector`s. Setting selectors provide a way to pass a key filter and label filter into the provider. ```python -from azure.appconfiguration.provider import load, SettingSelector +from azure.appconfiguration.provider import load, SettingSelector, NULL_LABEL from azure.identity import DefaultAzureCredential -selects = {SettingSelector(key_filter="*", label_filter="\0"), SettingSelector(key_filter="*", label_filter="dev")} +selects = {SettingSelector(key_filter="*", label_filter=NULL_LABEL), SettingSelector(key_filter="*", label_filter="dev")} config = load(endpoint=endpoint, credential=DefaultAzureCredential(), selects=selects) ``` diff --git a/sdk/appconfiguration/azure-appconfiguration-provider/azure/appconfiguration/provider/__init__.py b/sdk/appconfiguration/azure-appconfiguration-provider/azure/appconfiguration/provider/__init__.py index 87873c1bd5dc..3bf8e865e67c 100644 --- a/sdk/appconfiguration/azure-appconfiguration-provider/azure/appconfiguration/provider/__init__.py +++ b/sdk/appconfiguration/azure-appconfiguration-provider/azure/appconfiguration/provider/__init__.py @@ -10,6 +10,7 @@ SettingSelector, WatchKey, ) +from ._constants import NULL_LABEL from ._version import VERSION @@ -20,4 +21,5 @@ "AzureAppConfigurationKeyVaultOptions", "SettingSelector", "WatchKey", + "NULL_LABEL", ] diff --git a/sdk/appconfiguration/azure-appconfiguration-provider/azure/appconfiguration/provider/_constants.py b/sdk/appconfiguration/azure-appconfiguration-provider/azure/appconfiguration/provider/_constants.py index 3e68591bb46c..0544014c8514 100644 --- a/sdk/appconfiguration/azure-appconfiguration-provider/azure/appconfiguration/provider/_constants.py +++ b/sdk/appconfiguration/azure-appconfiguration-provider/azure/appconfiguration/provider/_constants.py @@ -69,3 +69,11 @@ # Miscellaneous Constants # ------------------------------------------------------------------------ NULL_CHAR = "\0" + +# ------------------------------------------------------------------------ +# Label Constants +# ------------------------------------------------------------------------ +NULL_LABEL = NULL_CHAR +"""Represents the null label (No Label) in Azure App Configuration. Use this constant +with :class:`~azure.appconfiguration.provider.SettingSelector` to select configuration +settings that have no label assigned.""" diff --git a/sdk/appconfiguration/azure-appconfiguration-provider/tests/test_setting_selector.py b/sdk/appconfiguration/azure-appconfiguration-provider/tests/test_setting_selector.py index 0011f62ca932..c77620a0b754 100644 --- a/sdk/appconfiguration/azure-appconfiguration-provider/tests/test_setting_selector.py +++ b/sdk/appconfiguration/azure-appconfiguration-provider/tests/test_setting_selector.py @@ -7,6 +7,7 @@ import pytest from azure.appconfiguration.provider._models import SettingSelector from azure.appconfiguration.provider._constants import NULL_CHAR +from azure.appconfiguration.provider import NULL_LABEL class TestSettingSelector: @@ -91,3 +92,11 @@ def test_setting_selector_different_label_filters(self): selector = SettingSelector(key_filter="*", tag_filters=["tag=value"]) assert selector.label_filter == NULL_CHAR + + def test_null_label_constant(self): + """Test that NULL_LABEL constant is exported and equals the null character.""" + assert NULL_LABEL == "\0" + assert NULL_LABEL == NULL_CHAR + + selector = SettingSelector(key_filter="*", label_filter=NULL_LABEL) + assert selector.label_filter == NULL_LABEL