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

FEAT-#7459: Add methods to get and set backend. #7460

Conversation

sfc-gh-mvashishtha
Copy link
Contributor

@sfc-gh-mvashishtha sfc-gh-mvashishtha commented Mar 8, 2025

Add get_backend() to get the backend for a dataframe or series. Add set_backend(), and its alias move_to(), to set the backend of a dataframe or series.

To implement set_backend(), extend FactoryDispatcher so that it can dispatch I/O operations to the backend that the user chooses instead of always using modin.config.Backend. set_backend() can then use FactoryDispatcher.from_pandas(backend=new_backend) to get a query compiler with the given backend.

This commit also updates the documentation for "native" execution mode to reflect the updated guidance of using Backend to control execution. It also adds examples of using get_backend() and set_backend().

  • first commit message and PR title follow format outlined here

    NOTE: If you edit the PR title to match this format, you need to add another commit (even if it's empty) or amend your last commit for the CI job that checks the PR title to pick up the new PR title.

  • passes flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
  • passes black --check modin/ asv_bench/benchmarks scripts/doc_checker.py
  • signed commit with git commit -s
  • Resolves Add DataFrame and Series methods to get and set backend. #7459
  • tests added and passing
  • module layout described at docs/development/architecture.rst is up-to-date

Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
…les.

Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
…into 7459/feat/add-get-and-set-backend-methods
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
@sfc-gh-mvashishtha sfc-gh-mvashishtha changed the title FEAT-#7459: Add methods to get and set data backend. FEAT-#7459: Add methods to get and set backend. Mar 12, 2025
Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
@sfc-gh-mvashishtha sfc-gh-mvashishtha requested a review from a team as a code owner March 12, 2025 07:22

@doc(SET_BACKEND_DOC, class_name=__qualname__)
def set_backend(self, backend: str, inplace: bool = False) -> Optional[Self]:
# TODO(https://github.com/modin-project/modin/issues/7467): refactor
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'm seeing the same issue

@sfc-gh-mvashishtha sfc-gh-mvashishtha merged commit 5c00dba into modin-project:main Mar 13, 2025
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add DataFrame and Series methods to get and set backend.
3 participants