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

Safety belt triggered #129

Closed
bennieswart opened this issue Aug 23, 2023 · 2 comments
Closed

Safety belt triggered #129

bennieswart opened this issue Aug 23, 2023 · 2 comments

Comments

@bennieswart
Copy link
Contributor

bennieswart commented Aug 23, 2023

Hi, thanks for the great work on this project. We rely on this quite heavily for some very important internal tools.

I recently upgraded from an older version to 5.3 and found this issue:

Python 3.11.3 (main, Jun  5 2023, 09:32:32) [GCC 13.1.1 20230429] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pglast import prettify
>>> prettify('select (false and true) is false', safety_belt=True)
Detected a non-cosmetic difference between this original statement:

select (false and true) is false

and the prettified one:

SELECT FALSE AND TRUE IS FALSE
/home/staple/goodx/goodxweb/.venv/lib/python3.11/site-packages/pglast/__init__.py:116: RuntimeWarning: Detected a non-cosmetic difference between original and prettified statements, please report
  warnings.warn("Detected a non-cosmetic difference between original and"
'select (false and true) is false'

EDIT: I'm working through all the errors triggering the safety belt now so I'll add more as I find them.

select a = (true is false) wrongly gives SELECT a = TRUE IS FALSE, however select a = (b = c) correctly gives SELECT a = (b = c).

EDIT: Seems like the above examples are the only issues highlighted in my case.

@lelit
Copy link
Owner

lelit commented Aug 23, 2023

Thanks for the report, I will investigate as soon as possible!

@bennieswart bennieswart changed the title Safety belt triggerred Safety belt triggered Aug 23, 2023
lelit added a commit that referenced this issue Aug 24, 2023
@lelit
Copy link
Owner

lelit commented Aug 24, 2023

This should be fixed in just released v3, v4 and v5!

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

No branches or pull requests

2 participants