Skip to content

Commit

Permalink
Merge pull request #1561 from skrah/foreign_key
Browse files Browse the repository at this point in the history
Issue #1552: Fix method discovery (foreign key)
  • Loading branch information
kwmsmith committed Aug 2, 2016
2 parents c744e9a + e19b0d9 commit 1f8e31e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion blaze/expr/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,13 @@ def __getattr__(self, key):
except AttributeError:
fields = dict(zip(map(valid_identifier, self.fields), self.fields))

measure = self.dshape.measure
if isinstance(measure, datashape.Map): # Foreign key
measure = measure.key

# prefer the method if there's a field with the same name
methods = toolz.merge(
schema_methods(self.dshape.measure),
schema_methods(measure),
dshape_methods(self.dshape)
)
if key in methods:
Expand Down

0 comments on commit 1f8e31e

Please sign in to comment.