@@ -85,27 +85,27 @@ def resolve_feature_flags(
8585
8686 - **Experimental Path** (env_var contains "EXPERIMENTAL"):
8787 Strict control. Requires the environment variable to be explicitly 'true'.
88- If a programmatic provider is passed but the environment variable is not 'true',
89- raises ValueError (Fail Fast).
88+ If a programmatic feature key is passed but the environment variable is not 'true',
89+ raises FeatureGatingError (Fail Fast).
9090
9191 - **GA Path** (env_var does not contain "EXPERIMENTAL"):
92- Standard precedence. Enabled if a programmatic provider is passed,
92+ Standard precedence. Enabled if a programmatic feature key is passed,
9393 otherwise falls back to the environment variable value.
9494
9595 Args:
9696 env_var: The name of the environment variable controlling this feature.
97- feature_key: The key in configuration/attributes for the programmatic provider .
97+ feature_key: The key in configuration/attributes for the programmatic configuration .
9898 configuration: Optional. A dictionary or object containing client configuration.
9999
100100 Returns:
101101 bool: True if the feature is resolved to enabled, False otherwise.
102102
103103 Raises:
104- ValueError : If a provider is provided for an experimental feature without enabling the experimental environment variable.
104+ FeatureGatingError : If a feature key is provided for an experimental feature without enabling the experimental environment variable.
105105 """
106106
107107 # Check for programmatic feature configuration
108- has_feature = _has_feature_key (
108+ has_feature_key = _has_feature_key (
109109 configuration = configuration , feature_key = feature_key
110110 )
111111
@@ -115,12 +115,12 @@ def resolve_feature_flags(
115115 # EXPERIMENTAL PATH:
116116 # Resolution Hierarchy:
117117 # 1. EXPERIMENTAL Environment Variable
118- # 2. Fail Fast if Provider present but EXPERIMENTAL Environment Variable is not enabled
118+ # 2. Fail Fast if Feature Key present but EXPERIMENTAL Environment Variable is not enabled
119119 if "EXPERIMENTAL" in env_var :
120120 # Fail Fast if feature key present but experimental environment variable is not enabled
121- if env_var_setting is not True and has_feature :
121+ if env_var_setting is not True and has_feature_key :
122122 raise FeatureGatingError (
123- f"Experimental feature requires { env_var } to be set to 'true' to use programmatic providers ."
123+ f"Experimental feature requires { env_var } to be set to 'true' to use programmatic configuration ."
124124 )
125125
126126 return bool (env_var_setting )
@@ -131,7 +131,7 @@ def resolve_feature_flags(
131131 # 2. Environment Variable
132132
133133 # Check Programmatic Configuration
134- if has_feature :
134+ if has_feature_key :
135135 return True
136136
137137 # Check Environment Variable
0 commit comments