Skip to content

Commit dcee13d

Browse files
REFACTOR-#4510: Align experimental and regular IO modules initializations (#4511)
Signed-off-by: alexander3774 <[email protected]>
1 parent 57e29bc commit dcee13d

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

docs/release_notes/release_notes-0.15.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Key Features and Updates
3838
* REFACTOR-#3642: Move PyArrow storage format usage from main feature to experimental ones (#4374)
3939
* REFACTOR-#4003: Delete the deprecated cloud mortgage example (#4406)
4040
* REFACTOR-#4513: Fix spelling mistakes in docs and docstrings (#4514)
41+
* REFACTOR-#4510: Align experimental and regular IO modules initializations (#4511)
4142
* Pandas API implementations and improvements
4243
*
4344
* OmniSci enhancements

modin/experimental/pandas/io.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
from . import DataFrame
2626
from modin.config import IsExperimental, Engine
27-
from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher
2827
from ...pandas import _update_engine
2928

3029

@@ -96,9 +95,13 @@ def read_sql(
9695
-------
9796
modin.DataFrame
9897
"""
98+
_, _, _, kwargs = inspect.getargvalues(inspect.currentframe())
99+
99100
Engine.subscribe(_update_engine)
101+
from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher
102+
100103
assert IsExperimental.get(), "This only works in experimental mode"
101-
_, _, _, kwargs = inspect.getargvalues(inspect.currentframe())
104+
102105
return DataFrame(query_compiler=FactoryDispatcher.read_sql(**kwargs))
103106

104107

@@ -137,9 +140,13 @@ def read_custom_text(
137140
-------
138141
modin.DataFrame
139142
"""
143+
_, _, _, kwargs = inspect.getargvalues(inspect.currentframe())
144+
140145
Engine.subscribe(_update_engine)
146+
from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher
147+
141148
assert IsExperimental.get(), "This only works in experimental mode"
142-
_, _, _, kwargs = inspect.getargvalues(inspect.currentframe())
149+
143150
return DataFrame(query_compiler=FactoryDispatcher.read_custom_text(**kwargs))
144151

145152

@@ -265,6 +272,7 @@ def _read(**kwargs) -> DataFrame:
265272
[4652013 rows x 18 columns]
266273
"""
267274
Engine.subscribe(_update_engine)
275+
from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher
268276

269277
try:
270278
pd_obj = FactoryDispatcher.read_csv_glob(**kwargs)
@@ -322,9 +330,13 @@ def read_pickle_distributed(
322330
-----
323331
The number of partitions is equal to the number of input files.
324332
"""
333+
_, _, _, kwargs = inspect.getargvalues(inspect.currentframe())
334+
325335
Engine.subscribe(_update_engine)
336+
from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher
337+
326338
assert IsExperimental.get(), "This only works in experimental mode"
327-
_, _, _, kwargs = inspect.getargvalues(inspect.currentframe())
339+
328340
return DataFrame(query_compiler=FactoryDispatcher.read_pickle_distributed(**kwargs))
329341

330342

@@ -369,6 +381,8 @@ def to_pickle_distributed(
369381
"""
370382
obj = self
371383
Engine.subscribe(_update_engine)
384+
from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher
385+
372386
if isinstance(self, DataFrame):
373387
obj = self._query_compiler
374388
FactoryDispatcher.to_pickle_distributed(

0 commit comments

Comments
 (0)