Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REFACTOR-#4510: Align experimental and regular IO modules initializations #4511

Merged
merged 3 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/release_notes/release_notes-0.15.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Key Features and Updates
* REFACTOR-#3642: Move PyArrow storage format usage from main feature to experimental ones (#4374)
* REFACTOR-#4003: Delete the deprecated cloud mortgage example (#4406)
* REFACTOR-#4513: Fix spelling mistakes in docs and docstrings (#4514)
* REFACTOR-#4510: Align experimental and regular IO modules initializations (#4511)
* Pandas API implementations and improvements
*
* OmniSci enhancements
Expand Down
22 changes: 18 additions & 4 deletions modin/experimental/pandas/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

from . import DataFrame
from modin.config import IsExperimental, Engine
from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher
from ...pandas import _update_engine


Expand Down Expand Up @@ -96,9 +95,13 @@ def read_sql(
-------
modin.DataFrame
"""
_, _, _, kwargs = inspect.getargvalues(inspect.currentframe())

Engine.subscribe(_update_engine)
from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher

assert IsExperimental.get(), "This only works in experimental mode"
_, _, _, kwargs = inspect.getargvalues(inspect.currentframe())

return DataFrame(query_compiler=FactoryDispatcher.read_sql(**kwargs))


Expand Down Expand Up @@ -137,9 +140,13 @@ def read_custom_text(
-------
modin.DataFrame
"""
_, _, _, kwargs = inspect.getargvalues(inspect.currentframe())

Engine.subscribe(_update_engine)
from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher

assert IsExperimental.get(), "This only works in experimental mode"
_, _, _, kwargs = inspect.getargvalues(inspect.currentframe())

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why the kwargs line was moved up?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, kwargs line was moved up to avoid passing FactoryDispatcher argument into kwargs. If FactoryDispatcher argument is present in the kwargs, it can break further io logic.

return DataFrame(query_compiler=FactoryDispatcher.read_custom_text(**kwargs))


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

try:
pd_obj = FactoryDispatcher.read_csv_glob(**kwargs)
Expand Down Expand Up @@ -322,9 +330,13 @@ def read_pickle_distributed(
-----
The number of partitions is equal to the number of input files.
"""
_, _, _, kwargs = inspect.getargvalues(inspect.currentframe())

Engine.subscribe(_update_engine)
from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher

assert IsExperimental.get(), "This only works in experimental mode"
_, _, _, kwargs = inspect.getargvalues(inspect.currentframe())

return DataFrame(query_compiler=FactoryDispatcher.read_pickle_distributed(**kwargs))


Expand Down Expand Up @@ -369,6 +381,8 @@ def to_pickle_distributed(
"""
obj = self
Engine.subscribe(_update_engine)
from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher

if isinstance(self, DataFrame):
obj = self._query_compiler
FactoryDispatcher.to_pickle_distributed(
Expand Down