Skip to content

Commit

Permalink
Pin xgboost_ray<0.1.14 (#3328)
Browse files Browse the repository at this point in the history
* Pin xgboost_ray<0.1.14

* DataFrameReadSQL compatible with SQLAlchemy > 2

---------

Co-authored-by: 刘宝 <po.lb@antgroup.com>
  • Loading branch information
fyrestone and 刘宝 committed Feb 14, 2023
1 parent c5488a9 commit b008a2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/platform-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
rm -fr /tmp/etcd-$ETCD_VER-linux-amd64.tar.gz /tmp/etcd-download-test
fi
if [ -n "$WITH_RAY" ] || [ -n "$WITH_RAY_DAG" ] || [ -n "$WITH_RAY_DEPLOY" ]; then
pip install "xgboost_ray" "protobuf<4"
pip install "xgboost_ray<0.1.14" "protobuf<4"
# Ray Datasets need pyarrow>=6.0.1
pip install "pyarrow>=6.0.1"
fi
Expand Down
6 changes: 2 additions & 4 deletions mars/dataframe/datasource/read_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,18 +355,16 @@ def _tile_partition(cls, op: "DataFrameReadSQL"):
from sqlalchemy import sql

engine = sa.create_engine(op.con, **(op.engine_kwargs or dict()))
try:
with engine.connect() as connection:
part_col = selectable.columns[op.partition_col]
range_results = engine.execute(
range_results = connection.execute(
sql.select(sql.func.min(part_col), sql.func.max(part_col))
)

op.low_limit, op.high_limit = next(range_results)
if op.parse_dates and op.partition_col in op.parse_dates:
op.low_limit = op._parse_datetime(op.low_limit)
op.high_limit = op._parse_datetime(op.high_limit)
finally:
engine.dispose()

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

0 comments on commit b008a2a

Please sign in to comment.