Skip to content
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

IN statement doesn't produce correct output when combined with partial statement returning a list #55

Open
BenedictBoyle opened this issue Jun 23, 2023 · 1 comment

Comments

@BenedictBoyle
Copy link
Contributor

I want to write something like:

p1 = Pypher()
p2 = Pypher()
p2.split(<some input>, ",")
p1.IN(p2)

But the way the class IN(Statement) is defined means that this will come out unnecessarily wrapped in square braces and the cypher engine will fall over when it gets a list of lists.

I think this could be fixed by adding some logic to the class definition of IN and am happy to do the work over the weekend to raise a PR but wondered if you had a preference for how to fix given you know + understand the codebase far better than me? I would do something like checking if the partial statement contains a split() or collect() but I feel like there's a lot of scope for missing cases there and seems not very elegant.

Also possible I've misunderstood how to make a partial properly and there's a way to do what I want without changing the code.

@emehrkay
Copy link
Owner

This is a good catch. I would definitely welcome your fix when you have time. Thanks

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

No branches or pull requests

2 participants