8000 format does not remove all the comments with strip_comments=True · Issue #801 · andialbrecht/sqlparse · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
format does not remove all the comments with strip_comments=True #801
Open
@rkrenzler

Description

@rkrenzler

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0