Skip to content

Commit

Permalink
Raise exception if pyarrow is imported before ray. (ray-project#1283)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
robertnishihara authored and pcmoritz committed Dec 8, 2017
1 parent 2e0eb0e commit 5adbdfe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/requirements-doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ funcsigs
mock
numpy
opencv-python
pyarrow
psutil
recommonmark
redis
Expand Down
2 changes: 0 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
"tensorflow.python",
"tensorflow.python.client",
"tensorflow.python.util",
"pyarrow",
"pyarrow.plasma",
"smart_open",
"ray.local_scheduler",
"ray.plasma",
Expand Down
6 changes: 6 additions & 0 deletions python/ray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

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__)),
Expand Down

0 comments on commit 5adbdfe

Please sign in to comment.