Skip to content

Commit

Permalink
fix(python): Account for minor change in new connectorx release (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-beedie authored Feb 15, 2025
1 parent 947dc07 commit 5e0bea4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion py-polars/polars/io/database/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from concurrent.futures import ThreadPoolExecutor
from typing import TYPE_CHECKING, Any

from polars._utils.various import parse_version
from polars.convert import from_arrow
from polars.dependencies import import_optional

Expand Down Expand Up @@ -62,10 +63,11 @@ def _read_sql_connectorx(
) -> DataFrame:
cx = import_optional("connectorx")
try:
return_type = "arrow2" if parse_version(cx.__version__) < (0, 4, 2) else "arrow"
tbl = cx.read_sql(
conn=connection_uri,
query=query,
return_type="arrow2",
return_type=return_type,
partition_on=partition_on,
partition_range=partition_range,
partition_num=partition_num,
Expand Down

0 comments on commit 5e0bea4

Please sign in to comment.