From f44be01e165471563927573734a41be4f7d55c9d Mon Sep 17 00:00:00 2001 From: fis Date: Thu, 21 May 2020 05:54:29 +0800 Subject: [PATCH] Py35. --- python-package/xgboost/core.py | 3 ++- python-package/xgboost/data.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/python-package/xgboost/core.py b/python-package/xgboost/core.py index d55e2c81250a..b6760ef8d1ec 100644 --- a/python-package/xgboost/core.py +++ b/python-package/xgboost/core.py @@ -270,7 +270,8 @@ def _convert_unknown_data(data, meta=None, meta_type=None): else: import warnings warnings.warn( - f'Unknown data type {type(data)}, coverting it to csr_matrix') + 'Unknown data type: ' + str(type(data)) + + ', coverting it to csr_matrix') try: data = scipy.sparse.csr_matrix(data) except Exception: diff --git a/python-package/xgboost/data.py b/python-package/xgboost/data.py index a1ed582c9343..2a8669d105ba 100644 --- a/python-package/xgboost/data.py +++ b/python-package/xgboost/data.py @@ -532,8 +532,8 @@ def get_device_quantile_dmatrix_data_handler( ''' handler = __device_quantile_dmatrix_registry.get_handler( data) - assert handler, f'Current data type {type(data)} is not supported' + \ - ' for DeviceQuantileDMatrix' + assert handler, 'Current data type ' + str(type(data)) +\ + ' is not supported for DeviceQuantileDMatrix' return handler(max_bin, missing, nthread, silent)