-
Notifications
You must be signed in to change notification settings - Fork 871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compare entities by ID in DFS #637
Changes from 8 commits
eae50af
8f04c04
46c28b3
cb9e6f4
7f408b7
726662a
82c573a
4307af7
2d853ef
6dd43c1
f7d1f92
d86b300
39c3819
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,9 +117,8 @@ def __eq__(self, other, deep=False): | |
return False | ||
if len(self.variables) != len(other.variables): | ||
return False | ||
for v in self.variables: | ||
if v not in other.variables: | ||
return False | ||
if set(self.variables) != set(other.variables): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed most of the places where this would be hit, but I thought I might as well make this comparison faster while we're looking at it. |
||
return False | ||
if deep: | ||
if self.last_time_index is None and other.last_time_index is not None: | ||
return False | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,7 +108,8 @@ def _is_unique(self): | |
"""Is there any other relationship with same parent and child entities?""" | ||
es = self.child_entity.entityset | ||
relationships = es.get_forward_relationships(self._child_entity_id) | ||
n = len([r for r in relationships if r.parent_entity == self.parent_entity]) | ||
n = len([r for r in relationships | ||
if r._parent_entity_id == self._parent_entity_id]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This case wasn't causing the observed performance drop, but I also don't see any reason to compare the actual entities here. |
||
|
||
assert n > 0, 'This relationship is missing from the entityset' | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to Future Release