Skip to content

Commit b91ae34

Browse files
authored
Removing Configuration Reference (#37)
1 parent 128cead commit b91ae34

File tree

4 files changed

+2
-19
lines changed

4 files changed

+2
-19
lines changed

featuremanagement/_featuremanagerbase.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,7 @@ def _variant_name_to_variant(self, feature_flag: FeatureFlag, variant_name: Opti
211211
return None
212212
for variant_reference in feature_flag.variants:
213213
if variant_reference.name == variant_name:
214-
configuration = variant_reference.configuration_value
215-
if not configuration and variant_reference.configuration_reference:
216-
configuration = self._configuration.get(variant_reference.configuration_reference)
217-
return Variant(variant_reference.name, configuration)
214+
return Variant(variant_reference.name, variant_reference.configuration_value)
218215
return None
219216

220217
def _build_targeting_context(self, args: Tuple[Any]) -> TargetingContext:

featuremanagement/_models/_constants.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@
3030
# Variant Reference
3131
VARIANT_REFERENCE_NAME = "name"
3232
CONFIGURATION_VALUE = "configuration_value"
33-
CONFIGURATION_REFERENCE = "configuration_reference"
3433
STATUS_OVERRIDE = "status_override"

featuremanagement/_models/_variant_reference.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from dataclasses import dataclass
77
from typing import Optional, Mapping, Any
88
from typing_extensions import Self
9-
from ._constants import VARIANT_REFERENCE_NAME, CONFIGURATION_VALUE, CONFIGURATION_REFERENCE, STATUS_OVERRIDE
9+
from ._constants import VARIANT_REFERENCE_NAME, CONFIGURATION_VALUE, STATUS_OVERRIDE
1010

1111

1212
@dataclass
@@ -18,7 +18,6 @@ class VariantReference:
1818
def __init__(self) -> None:
1919
self._name = None
2020
self._configuration_value = None
21-
self._configuration_reference = None
2221
self._status_override = None
2322

2423
@classmethod
@@ -33,7 +32,6 @@ def convert_from_json(cls, json: Mapping[str, Any]) -> Self:
3332
variant_reference = cls()
3433
variant_reference._name = json.get(VARIANT_REFERENCE_NAME)
3534
variant_reference._configuration_value = json.get(CONFIGURATION_VALUE)
36-
variant_reference._configuration_reference = json.get(CONFIGURATION_REFERENCE)
3735
variant_reference._status_override = json.get(STATUS_OVERRIDE, None)
3836
return variant_reference
3937

@@ -57,16 +55,6 @@ def configuration_value(self) -> Optional[str]:
5755
"""
5856
return self._configuration_value
5957

60-
@property
61-
def configuration_reference(self) -> Optional[str]:
62-
"""
63-
Get the configuration reference for the variant.
64-
65-
:return: Configuration reference for the variant.
66-
:rtype: str
67-
"""
68-
return self._configuration_reference
69-
7058
@property
7159
def status_override(self) -> Optional[str]:
7260
"""

samples/formatted_feature_flags.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@
218218
},
219219
{
220220
"name": "False_Override",
221-
"configuration_reference": "false-override",
222221
"status_override": "True"
223222
}
224223
]

0 commit comments

Comments
 (0)