Skip to content

Commit

Permalink
replace semicolon of query with null string ""
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-m-young committed Apr 4, 2024
1 parent 63fb3af commit 13808f8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion connectorx-python/connectorx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def read_sql(
"""
if isinstance(query, list) and len(query) == 1:
query = query[0]
query = query.replace(";","")

if isinstance(conn, dict):
assert partition_on is None and isinstance(
Expand All @@ -214,6 +215,8 @@ def read_sql(
assert (
protocol is None
), "Federated query does not support specifying protocol for now"

query = query.replace(";","")
result = _read_sql2(query, conn)
df = reconstruct_arrow(result)
if return_type == "pandas":
Expand All @@ -232,6 +235,7 @@ def read_sql(
return df

if isinstance(query, str):
query = query.replace(";","")
if partition_on is None:
queries = [query]
partition_query = None
Expand All @@ -245,7 +249,7 @@ def read_sql(
}
queries = None
elif isinstance(query, list):
queries = query
queries = [subquery.replace(";","") for subquery in query]
partition_query = None

if partition_on is not None:
Expand Down

0 comments on commit 13808f8

Please sign in to comment.