Skip to content

Commit 013cd1b

Browse files
author
Jean Bredeche
authored
Merge pull request #2421 from quantopian/its-a-nested-dict-how-could-anyone-have-guessed-that
use identity of odo_kwargs for id/eq
2 parents 25510b8 + 0f85ae6 commit 013cd1b

File tree

1 file changed

+6
-5
lines changed
  • zipline/pipeline/loaders/blaze

1 file changed

+6
-5
lines changed

zipline/pipeline/loaders/blaze/core.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ def __new__(cls,
729729
expr,
730730
deltas,
731731
checkpoints,
732-
frozenset((odo_kwargs or {}).items()),
732+
odo_kwargs or {},
733733
)
734734

735735
def __repr__(self):
@@ -739,15 +739,17 @@ def __repr__(self):
739739
str(self.expr),
740740
str(self.deltas),
741741
str(self.checkpoints),
742-
dict(self.odo_kwargs),
742+
self.odo_kwargs,
743743
))
744744

745745
@staticmethod
746746
def _expr_eq(a, b):
747747
return a is b is None or a.isidentical(b)
748748

749749
def __hash__(self):
750-
return super(ExprData, self).__hash__()
750+
return hash(
751+
(self.expr, self.deltas, self.checkpoints, id(self.odo_kwargs))
752+
)
751753

752754
def __eq__(self, other):
753755
if not isinstance(other, ExprData):
@@ -757,7 +759,7 @@ def __eq__(self, other):
757759
self._expr_eq(self.expr, other.expr) and
758760
self._expr_eq(self.deltas, other.deltas) and
759761
self._expr_eq(self.checkpoints, other.checkpoints) and
760-
self.odo_kwargs == other.odo_kwargs
762+
self.odo_kwargs is other.odo_kwargs
761763
)
762764

763765
def __ne__(self, other):
@@ -924,7 +926,6 @@ def _load_dataset(self,
924926
)
925927

926928
expr, deltas, checkpoints, odo_kwargs = expr_data
927-
odo_kwargs = dict(odo_kwargs)
928929

929930
have_sids = (first(columns).dataset.ndim == 2)
930931
added_query_fields = {AD_FIELD_NAME, TS_FIELD_NAME} | (

0 commit comments

Comments
 (0)