Skip to content

Commit 93157e0

Browse files
pcmoritzedoakes
authored andcommitted
Make sure numpy >= 1.16.0 is installed for fast pickling support (#6486)
* Make sure numpy >= 1.16.0 is installed * Works for 1.15.4 * lint * formatting * update * put check into the right place * lint
1 parent 1c389fc commit 93157e0

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

python/ray/parameter.py

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
import logging
66

7+
import numpy as np
8+
from packaging import version
9+
710
import ray.ray_constants as ray_constants
811

912

@@ -207,3 +210,10 @@ def _check_usage(self):
207210
if self.redirect_output is not None:
208211
raise DeprecationWarning(
209212
"The redirect_output argument is deprecated.")
213+
214+
if self.use_pickle:
215+
assert (version.parse(
216+
np.__version__) >= version.parse("1.16.0")), (
217+
"numpy >= 1.16.0 required for use_pickle=True support. "
218+
"You can use ray.init(use_pickle=False) for older numpy "
219+
"versions, but this may be removed in future versions.")

python/ray/serialization.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
from __future__ import absolute_import
22
from __future__ import division
33
from __future__ import print_function
4+
45
import hashlib
56
import io
67
import logging
78
import time
9+
810
import pyarrow
911
import pyarrow.plasma as plasma
12+
1013
import ray.cloudpickle as pickle
1114
from ray import ray_constants, JobID
1215
import ray.utils

python/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def find_version(*filepath):
160160

161161

162162
requires = [
163-
"numpy >= 1.14",
163+
"numpy >= 1.16",
164164
"filelock",
165165
"jsonschema",
166166
"funcsigs",

0 commit comments

Comments
 (0)