operator.add,
[
sc._annotations.get("weight", 1)
- for sc in col._uncached_proxy_set()
+ for sc in col._uncached_proxy_list()
if sc.shares_lineage(column)
],
)
operator.add,
[
sc._annotations.get("weight", 1)
- for sc in c._uncached_proxy_set()
+ for sc in c._uncached_proxy_list()
if sc.shares_lineage(column)
],
)
@util.memoized_property
def proxy_set(self):
- s = util.column_set([self])
+ s = util.column_set([self._deannotate()])
for c in self._proxies:
s.update(c.proxy_set)
return s
- def _uncached_proxy_set(self):
+ def _uncached_proxy_list(self):
"""An 'uncached' version of proxy set.
This is so that we can read annotations from the list of columns
without breaking the caching of the above proxy_set.
"""
- s = util.column_set([self])
+ s = [self]
for c in self._proxies:
- s.update(c._uncached_proxy_set())
+ s.extend(c._uncached_proxy_list())
return s
def shares_lineage(self, othercolumn):
# proxy_set, as corresponding_column iterates through proxy_set
# in this way
d = {}
- for col in p2._uncached_proxy_set():
+ for col in p2._uncached_proxy_list():
d.update(col._annotations)
eq_(d, {"weight": 10})
proxy._proxies = [c1._annotate({"weight": 10})]
d = {}
- for col in proxy._uncached_proxy_set():
+ for col in proxy._uncached_proxy_list():
d.update(col._annotations)
eq_(d, {"weight": 10})