8000 Fix compute_hash (#450) · ericmicrofocus/botbuilder-python@2b38e87 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2b38e87

Browse files
mdrichardsonaxelsrz
authored andcommitted
Fix compute_hash (microsoft#450)
* Fix compute_hash * added import * pylint fix
1 parent 2bfacd5 commit 2b38e87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/botbuilder-core/botbuilder/core/bot_state.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from abc import abstractmethod
55
from copy import deepcopy
66
from typing import Callable, Dict, Union
7+
from jsonpickle.pickler import Pickler
78
from botbuilder.core.state_property_accessor import StatePropertyAccessor
89
from .turn_context import TurnContext
910
from .storage import Storage
@@ -24,8 +25,7 @@ def is_changed(self) -> bool:
2425
return self.hash != self.compute_hash(self.state)
2526

2627
def compute_hash(self, obj: object) -> str:
27-
# TODO: Should this be compatible with C# JsonConvert.SerializeObject ?
28-
return str(obj)
28+
return str(Pickler().flatten(obj))
2929

3030

3131
class BotState(PropertyManager):

0 commit comments

Comments
 (0)
0