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

Support JOINs with _SetOperation subqueries (union, itersect, except, minus) #457

Merged
merged 1 commit into from
Jun 29, 2020

Conversation

foggel
Copy link

@foggel foggel commented Jun 27, 2020

Joining with a union subquery fails with: ValueError: Cannot join on type '<class 'pypika.queries._SetOperation'>'

Example:

        subquery = (
            Query.from_(self.table_abc).select("*")
            .union(
                Query.from_(self.table_abc).select("*")
            ).as_("subq")
        )

        test_query = (
            Query.from_(self.table_abc)
            .join(subquery)
            .on(subquery.x == self.table_abc.id)
            .select(self.table_abc.foo)
        )

@foggel foggel requested review from twheys and a team as code owners June 27, 2020 21:45
@coveralls
Copy link

coveralls commented Jun 27, 2020

Coverage Status

Coverage increased (+0.002%) to 98.174% when pulling 1f6ab34 on foggel:master into 75255d2 on kayak:master.

@gl3nn gl3nn merged commit 34f5c24 into kayak:master Jun 29, 2020
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.

None yet

3 participants