-
Notifications
You must be signed in to change notification settings - Fork 192
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
QueryBuilder
: using edge_filters
when joining with with_ancestors
raises
#4305
Comments
Oh come on, the error message could not be clearer ;) |
I understand that that is the problem, where the exception is raised and what it is saying. However, the question is whether it should raise for the query that I defined. The query:
to me makes perfect sense. It says:
for this trivial example, using
These queries make sense right? Or am I missing something? The reason I ran into this is because in the scope of PR #4306 we are thinking of adding the |
In principle, it would make sense to augment the links that are traversed, but this will be tough. To explain: the ancestor/descendant relationship is queried via a common table expression (CTE), which creates a new table (in memory) on demand, containing ancestor_id and descendant_id (you can also ask for the traversed nodes to be put in a list, that would be another column, not done by default because the query-time goes up x10). This table does not contain info over which types of links were traversed. And that CTE is hardcoded with the types of links that are allowed, so if you want the user to define it you'd have to implement this. Caution however: if you query something with a cycle you end up in an infinite loop. |
Code snippet that will trigger it:
the exception that is raised:
Note that I had to adapt the exception message of
get_column
itself, because it would also try to address an attribute of thealias
variable, but the whole problem is thatalias
is not an instance ofAlias
but ofsqlalchemy.sql.base.ImmutableColumnCollection
.@lekah I tried looking into this, but could really use your help here.
The text was updated successfully, but these errors were encountered: