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

format does not remove all the comments with strip_comments=True #801

Open
rkrenzler opened this issue Jan 6, 2025 · 0 comments
Open

format does not remove all the comments with strip_comments=True #801

rkrenzler opened this issue Jan 6, 2025 · 0 comments

Comments

@rkrenzler
Copy link

Describe the bug
sqlparse.format(query, strip_comments=True) sometimes does not strip all the comments from the query in sqlparse versions 0.5.2 and 0.5.3.

To Reproduce

import sqlparse

query = "--A;\n--B;"
result = sqlparse.format(query, strip_comments=True)

result is --B;

Expected behavior
result should be empty. It is empty in sqlparse version 0.5.1 but not in 0.5.2 and 0.5.3.

Versions:

  • Python: 3.11.9
  • sqlparse: 0.5.2 and 0.5.3
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

1 participant