Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")}
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example uses a set literal for selects, but the provider API is typed/documented as List[SettingSelector] and the paragraph below relies on selector order for precedence. Sets are unordered, so this example can produce non-deterministic precedence. Use a list (e.g., [...]) to preserve order, and keep the explanation consistent with that.

Suggested change
selects = {SettingSelector(key_filter="*", label_filter=NULL_LABEL), SettingSelector(key_filter="*", label_filter="dev")}
selects = [
SettingSelector(key_filter="*", label_filter=NULL_LABEL),
SettingSelector(key_filter="*", label_filter="dev"),
]

Copilot uses AI. Check for mistakes.
config = load(endpoint=endpoint, credential=DefaultAzureCredential(), selects=selects)
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
SettingSelector,
WatchKey,
)
from ._constants import NULL_LABEL

from ._version import VERSION

Expand All @@ -20,4 +21,5 @@
"AzureAppConfigurationKeyVaultOptions",
"SettingSelector",
"WatchKey",
"NULL_LABEL",
]
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Comment on lines +76 to +79
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The triple-quoted string after NULL_LABEL = NULL_CHAR is a standalone module string literal (it does not attach as documentation to NULL_LABEL). This likely won’t show up in generated docs and is effectively dead code. Convert it to a normal comment (or a #: doc comment if you want Sphinx to pick it up), or move the text into an appropriate module/doc location.

Suggested change
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."""
#: 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.
NULL_LABEL = NULL_CHAR

Copilot uses AI. Check for mistakes.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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