Skip to content

Commit a2819cf

Browse files
committed
fix: use correct return type for Hook.before method
1 parent 7f85ae2 commit a2819cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

openfeature/hook/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ class HookContext:
2626

2727

2828
class Hook:
29-
def before(self, hook_context: HookContext, hints: dict) -> EvaluationContext:
29+
def before(
30+
self, hook_context: HookContext, hints: dict
31+
) -> typing.Optional[EvaluationContext]:
3032
"""
3133
Runs before flag is resolved.
3234
@@ -36,7 +38,7 @@ def before(self, hook_context: HookContext, hints: dict) -> EvaluationContext:
3638
:return: An EvaluationContext. It will be merged with the
3739
EvaluationContext instances from other hooks, the client and API.
3840
"""
39-
pass
41+
return None
4042

4143
def after(
4244
self, hook_context: HookContext, details: FlagEvaluationDetails, hints: dict

0 commit comments

Comments
 (0)