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

Line break introduced in the middle of cross join #110

Closed
rdeese opened this issue Feb 2, 2022 · 3 comments
Closed

Line break introduced in the middle of cross join #110

rdeese opened this issue Feb 2, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@rdeese
Copy link

rdeese commented Feb 2, 2022

Hi, wanted to lead off by saying how excited we are by this tool. Thanks for your work on it. Now, to the issue at hand.

sqlfmt 0.4.2 formats this query with a line break between "cross" and "join":

select foo.*, bar.*
from {{ ref('foo_foo_foo') }} as foo cross
join {{ ref('bar_bar_bar') }} as bar

I would prefer to have cross join together on the new line, like so:

select foo.*, bar.*
from {{ ref('foo_foo_foo') }} as foo
cross join {{ ref('bar_bar_bar') }} as bar

Feel free to close the issue if this is intended behavior, but I found it surprising and suspect it might be a bug.

@tconbeer
Copy link
Owner

tconbeer commented Feb 2, 2022

Thanks for the report, @rdeese ! I'm excited too 😀

What you're seeing is definitely not the intended behavior. My guess is that we're not parsing that token correctly. Should be an easy fix if that's the case. I'll keep you updated here

@tconbeer tconbeer added the bug Something isn't working label Feb 2, 2022
@tconbeer
Copy link
Owner

tconbeer commented Feb 2, 2022

Yep, this is easy. Should be fixed in 0.5.0 this week

tconbeer added a commit that referenced this issue Feb 2, 2022
@tconbeer
Copy link
Owner

tconbeer commented Feb 2, 2022

0.5.0 has been released! Please upgrade for the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants