Skip to content

Commit

Permalink
Merge pull request #601 from surister/rewrite-semicolon-support
Browse files Browse the repository at this point in the history
Re-write `remove_ending_semicolon`
  • Loading branch information
wangxiaoying committed Apr 17, 2024
2 parents 181b9d3 + 339a150 commit 04bdb01
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions connectorx-python/connectorx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,15 @@ def reconstruct_pandas(df_infos: dict[str, Any]):


def remove_ending_semicolon(query: str) -> str:
if query[-1] == ";":
query = list(query)
query.pop(-1)
query = "".join(query)
"""
Removes the semicolon if the query ends with it.
Parameters
==========
query
SQL query
"""
if query.endswith(';'):
query = query[:-1]
return query

0 comments on commit 04bdb01

Please sign in to comment.