|
2 | 2 | This submodule contains the client class that provides most of the SDK functionality. |
3 | 3 | """ |
4 | 4 |
|
5 | | -from typing import Optional, Any, Dict, Mapping, Union, Tuple, Callable, List |
| 5 | +from typing import Optional, Any, Dict, Mapping, Tuple, Callable, List |
6 | 6 |
|
7 | 7 | from .impl import AnyNum |
8 | 8 |
|
9 | 9 | import hashlib |
10 | 10 | import hmac |
11 | 11 | import threading |
12 | 12 | import traceback |
13 | | -import warnings |
14 | 13 |
|
15 | 14 | from ldclient.config import Config |
16 | 15 | from ldclient.context import Context |
@@ -451,7 +450,7 @@ def evaluate(): |
451 | 450 | tracker = OpTracker(key, flag, context, detail, default_stage) |
452 | 451 | return _EvaluationWithHookResult(evaluation_detail=detail, results={'default_stage': default_stage, 'tracker': tracker}) |
453 | 452 |
|
454 | | - hook_result = self.__evaluate_with_hooks(key=key, context=context, default_value=default_stage, method="migration_variation", block=evaluate) |
| 453 | + hook_result = self.__evaluate_with_hooks(key=key, context=context, default_value=default_stage.value, method="migration_variation", block=evaluate) |
455 | 454 | return hook_result.results['default_stage'], hook_result.results['tracker'] |
456 | 455 |
|
457 | 456 | def _evaluate_internal(self, key: str, context: Context, default: Any, event_factory) -> Tuple[EvaluationDetail, Optional[FeatureFlag]]: |
@@ -652,7 +651,7 @@ def __execute_after_evaluation(self, hooks: List[Hook], series_context: Evaluati |
652 | 651 | for (hook, data) in reversed(list(zip(hooks, hook_data))) |
653 | 652 | ] |
654 | 653 |
|
655 | | - def __try_execute_stage(self, method: str, hook_name: str, block: Callable[[], dict]) -> Optional[dict]: |
| 654 | + def __try_execute_stage(self, method: str, hook_name: str, block: Callable[[], Any]) -> Any: |
656 | 655 | try: |
657 | 656 | return block() |
658 | 657 | except BaseException as e: |
|
0 commit comments