Skip to content

Commit

Permalink
FIX-modin-project#1852: Add stub engines to known ones during test-in…
Browse files Browse the repository at this point in the history
…ternals (modin-project#1853)

Signed-off-by: Vasilij Litvinov <vasilij.n.litvinov@intel.com>
  • Loading branch information
vnlitvinov authored and aregm committed Sep 16, 2020
1 parent a777ecf commit 046f20f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions modin/data_management/test/test_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
from modin.data_management.dispatcher import EngineDispatcher, FactoryNotFoundError
from modin.data_management import factories

import modin.pandas as pd


class PandasOnTestFactory(factories.BaseFactory):
"""
Expand Down Expand Up @@ -63,6 +65,9 @@ def prepare(cls):
factories.TestOnPythonFactory = TestOnPythonFactory
factories.FooOnBarFactory = FooOnBarFactory

# register them as known "no init" engines for modin.pandas
pd._NOINIT_ENGINES |= {"Test", "Bar"}


def test_default_engine():
assert issubclass(EngineDispatcher.get_engine(), factories.BaseFactory)
Expand Down
5 changes: 4 additions & 1 deletion modin/pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@

_is_first_update = {}
dask_client = None
_NOINIT_ENGINES = {
"Python"
} # engines that don't require initialization, useful for unit tests


def _update_engine(publisher: Publisher):
Expand Down Expand Up @@ -157,7 +160,7 @@ def init_remote_ray():

num_cpus = remote_ray.cluster_resources()["CPU"]

elif publisher.get() != "Python":
elif publisher.get() not in _NOINIT_ENGINES:
raise ImportError("Unrecognized execution engine: {}.".format(publisher.get()))

_is_first_update[publisher.get()] = False
Expand Down

0 comments on commit 046f20f

Please sign in to comment.