Skip to content

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?

Copy link

Choose a reason for hiding this comment

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

This method must be called for return self of Query instance and able to continue make Build query

@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.

@williambdean
Copy link
Contributor

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.

3 participants