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

fix cross join test and add docs #776

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raayu83
Copy link

@raayu83 raayu83 commented Dec 2, 2023

Fixes the cross join test (cross joins don't have an on clause) and adds documentation that you need to use .cross() after a cross_join().

@raayu83 raayu83 requested a review from a team as a code owner December 2, 2023 00:07

self.assertEqual(expected, str(query))

with self.subTest("join function"):
query = Query.from_(self.table0).cross_join(self.table1).on(self.table0.foo == self.table1.bar).select("*")
query = Query.from_(self.table0).cross_join(self.table1).cross().select("*")
Copy link
Contributor

Choose a reason for hiding this comment

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

This might be an API design item, but why does cross and cross_join have to be called?
Does cross take arguments?

@raayu83
Copy link
Author

raayu83 commented Jan 18, 2024

I don't know why it is like this since I didn't implement this, but as pypika is now this is AFAIK the correct way to do a cross join.

@wd60622
Copy link
Contributor

wd60622 commented Jan 20, 2024

I don't know why it is like this since I didn't implement this, but as pypika is now this is AFAIK the correct way to do a cross join.

Do you think omitting it is more intuitive? If so, feel free to make a change in that direction

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.

2 participants