Skip to content

Conversation

@mpsolano
Copy link
Member

No description provided.

), "Please narrow your search by specifying a node subclass"
# TODO: This is the original
for e in entities:
self = self.join(*getattr(self.entity(), e).attr)
Copy link
Contributor

@kulgan kulgan Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not obvious but its creating two join statements, one for the edge and the other for the destination node. Not clear if both joins will need an alias, but pretty sure the destination node needs one.
I played with this a little bit and was able to get the existing tests to pass

this = self
for e in entities:
  relation = getattr(self.entity(), e)
  alias = aliased(Node.get_subclass_named(relation.target_class.__dst_class__))
  this = self.join(relation.attr[0], relation.attr[1].of_type(alias))

I also had to make an update to self.entity() to cater for when the join_point is an AliasedClass not an entity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants