10000 Formatting error when using the postgres ?& json operator · Issue #690 · tconbeer/sqlfmt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Formatting error when using the postgres ?& json operator #690

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

Open
thiemonipro opened this issue Apr 7, 2025 · 1 comment
Open

Formatting error when using the postgres ?& json operator #690

thiemonipro opened this issue Apr 7, 2025 · 1 comment

Comments

@thiemonipro
Copy link

Describe the bug

To Reproduce
Format the following example:

select '{"a":[1,2,3],"b":[4,5,6]}'::jsonb ?& array['a', 'c']

Expected behavior
I expect that the operator stays intact and is not split up by a space. I don't expect any formatting changes.

Actual behavior
A space is added between the parts of the operator.

Formatted code

select '{"a":[1,2,3],"b":[4,5,6]}'::jsonb ? & array['a', 'c']

Additional context
What is the output of sqlfmt --version?

Tested on 0.21.2 and 0.26.0 using python 3.9.6

Package Version


appdirs 1.4.4
black 24.1.1
chardet 5.2.0
click 8.1.7
colorama 0.4.6
diff_cover 8.0.3
exceptiongroup 1.2.0
Faker 24.4.0
iniconfig 2.0.0
Jinja2 3.1.3
MarkupSafe 2.1.4
mypy-extensions 1.0.0
numpy 1.26.4
packaging 23.2
pandas 2.2.1
pathspec 0.12.1
pip 23.2.1
platformdirs 4.2.0
pluggy 1.4.0
Pygments 2.17.2
pytest 8.0.0
python-dateutil 2.9.0.post0
pytz 2024.1
PyYAML 6.0.1
regex 2023.12.25
setuptools 68.2.0
shandy-sqlfmt 0.26.0
six 1.16.0
sqlfluff 2.3.5
tblib 3.0.0
toml 0.10.2
tomli 2.0.1
tqdm 4.66.1
typing_extensions 4.9.0
tzdata 2024.1
wheel 0.41.2
yamllint 1.37.0

[notice] A new release of pip is available: 23.2.1 -> 25.0.1

@thiemonipro
Copy link
Author

Feel free to close this if you consider this a duplicate of #461.

@thiemonipro thiemonipro changed the title Formatting error when using the postgres **?&** json operator Formatting error when using the postgres '?&' json operator Apr 11, 2025
@thiemonipro thiemonipro changed the title Formatting error when using the postgres '?&' json operator Formatting error when using the postgres ?& json operator Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
La 3A08 bels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0