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

between's "and" should be higher priority than other "ands" #207

Closed
tconbeer opened this issue Jul 14, 2022 · 0 comments · Fixed by #244
Closed

between's "and" should be higher priority than other "ands" #207

tconbeer opened this issue Jul 14, 2022 · 0 comments · Fixed by #244
Labels
bug Something isn't working
Milestone

Comments

@tconbeer
Copy link
Owner

Describe the bug
Today we don't split before a between's and, see #124
But this is wrong, we should still split before it, we should just merge it more aggressively than other ands.

To Reproduce
From Gitlab

Expected behavior

            between namespace_snapshots.valid_from::date
            and namespace_snapshots.valid_to_::date

Actual behavior

            between namespace_snapshots.valid_from
            ::date and namespace_snapshots.valid_to_::date

Additional context
What is the output of sqlfmt --version?
commit 88617d2 (0.10pre)

@tconbeer tconbeer added the bug Something isn't working label Jul 14, 2022
@tconbeer tconbeer added this to the v0.11.0 milestone Aug 2, 2022
tconbeer added a commit that referenced this issue Aug 18, 2022
* refactor: simplify op priority logic

* chore: bump development to py3.10, fix warnings

* fix: do not treat square brackets as standalone operators (regression from prev commit)

* refactor: create OperatorPrecedence enum and tiers

* feat: parse more operators into specific tiers

* fix #207: between's and now a tight word operator

* feat: add more granular operator precedence, close #200

* chore: update changelog and readme

* chore: bump primer refs

* fix: fix bugs in op precedence, improve test coverage

* fix: update primer stats for dbt-utils
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

Successfully merging a pull request may close this issue.

1 participant