mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 11:37:28 +08:00
Raise exception if pyarrow is imported before ray. (#1283)
* Raise exception if pyarrow is imported before ray. * Pip install pyarrow when building doc so we don't have to mock it. * Raise ImportError instead of Exception.
This commit is contained in:
committed by
Philipp Moritz
parent
2e0eb0e4c7
commit
5adbdfecd0
@@ -5,6 +5,7 @@ funcsigs
|
||||
mock
|
||||
numpy
|
||||
opencv-python
|
||||
pyarrow
|
||||
psutil
|
||||
recommonmark
|
||||
redis
|
||||
|
||||
@@ -32,8 +32,6 @@ MOCK_MODULES = ["gym",
|
||||
"tensorflow.python",
|
||||
"tensorflow.python.client",
|
||||
"tensorflow.python.util",
|
||||
"pyarrow",
|
||||
"pyarrow.plasma",
|
||||
"smart_open",
|
||||
"ray.local_scheduler",
|
||||
"ray.plasma",
|
||||
|
||||
@@ -4,6 +4,12 @@ from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
if "pyarrow" in sys.modules:
|
||||
raise ImportError("Ray must be imported before pyarrow because Ray "
|
||||
"requires a specific version of pyarrow (which is "
|
||||
"packaged along with Ray).")
|
||||
|
||||
# Add the directory containing pyarrow to the Python path so that we find the
|
||||
# pyarrow version packaged with ray and not a pre-existing pyarrow.
|
||||
pyarrow_path = os.path.join(os.path.abspath(os.path.dirname(__file__)),
|
||||
|
||||
Reference in New Issue
Block a user