Skip to content

Commit 4f5e1f7

Browse files
committed
fix: compare keys as uppercase to restore Dynaconf fresh_vars support
1 parent 1764be1 commit 4f5e1f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pr_agent/custom_merge_loader.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def load(obj, env=None, silent=True, key=None, filename=None):
1212
- Replaces list and dict fields instead of appending/updating (non-default Dynaconf behavior).
1313
- Enforces several security checks (e.g., disallows includes/preloads and enforces .toml files).
1414
- Supports optional single-key loading.
15+
- Supports Dynaconf's fresh_vars feature for dynamic reloading.
1516
Args:
1617
obj: The Dynaconf settings instance to update.
1718
env: The current environment name (upper case). Defaults to 'DEVELOPMENT'. Note: currently unused.
@@ -93,7 +94,8 @@ def load(obj, env=None, silent=True, key=None, filename=None):
9394

9495
# Update the settings object
9596
for k, v in accumulated_data.items():
96-
if key is None or key == k:
97+
# For fresh_vars support: key parameter is uppercase, but accumulated_data keys are lowercase
98+
if key is None or key.upper() == k.upper():
9799
obj.set(k, v)
98100

99101
def validate_file_security(file_data, filename):

0 commit comments

Comments
 (0)