Skip to content

Commit b008a2a

Browse files
fyrestone刘宝
andauthored
Pin xgboost_ray<0.1.14 (#3328)
* Pin xgboost_ray<0.1.14 * DataFrameReadSQL compatible with SQLAlchemy > 2 --------- Co-authored-by: 刘宝 <po.lb@antgroup.com>
1 parent c5488a9 commit b008a2a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

.github/workflows/platform-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
rm -fr /tmp/etcd-$ETCD_VER-linux-amd64.tar.gz /tmp/etcd-download-test
105105
fi
106106
if [ -n "$WITH_RAY" ] || [ -n "$WITH_RAY_DAG" ] || [ -n "$WITH_RAY_DEPLOY" ]; then
107-
pip install "xgboost_ray" "protobuf<4"
107+
pip install "xgboost_ray<0.1.14" "protobuf<4"
108108
# Ray Datasets need pyarrow>=6.0.1
109109
pip install "pyarrow>=6.0.1"
110110
fi

mars/dataframe/datasource/read_sql.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,18 +355,16 @@ def _tile_partition(cls, op: "DataFrameReadSQL"):
355355
from sqlalchemy import sql
356356

357357
engine = sa.create_engine(op.con, **(op.engine_kwargs or dict()))
358-
try:
358+
with engine.connect() as connection:
359359
part_col = selectable.columns[op.partition_col]
360-
range_results = engine.execute(
360+
range_results = connection.execute(
361361
sql.select(sql.func.min(part_col), sql.func.max(part_col))
362362
)
363363

364364
op.low_limit, op.high_limit = next(range_results)
365365
if op.parse_dates and op.partition_col in op.parse_dates:
366366
op.low_limit = op._parse_datetime(op.low_limit)
367367
op.high_limit = op._parse_datetime(op.high_limit)
368-
finally:
369-
engine.dispose()
370368

371369
if isinstance(op.low_limit, (datetime.datetime, np.datetime64, pd.Timestamp)):
372370
seps = pd.date_range(op.low_limit, op.high_limit, op.num_partitions + 1)

0 commit comments

Comments
 (0)