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

PERF-#6749: Preserve partial dtype for the result of 'reset_index()' #6751

Merged
merged 3 commits into from
Nov 20, 2023

Conversation

dchigarev
Copy link
Collaborator

@dchigarev dchigarev commented Nov 17, 2023

What do these changes do?

Preserve partial dtypes for the result of .reset_index() by using ModinDtypes.concat() API

  • 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 Preserve partial dtype for the result of .reset_index() #6749
  • tests added and passing
  • module layout described at docs/development/architecture.rst is up-to-date

Sorry, something went wrong.

…set_index()'

Signed-off-by: Dmitry Chigarev <dmitry.chigarev@intel.com>
Signed-off-by: Dmitry Chigarev <dmitry.chigarev@intel.com>
try:
new_dtypes = ModinDtypes.concat([new_dtypes, self._dtypes])
except NotImplementedError:
# can raise on duplicated labels
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the old procedure worked in this case, then it can still be used.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@dchigarev can I merge it, or will you look at this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll look at this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added the old logic to ModinDtypes.concat(), however, it's still worth keeping this try-except block here, since it still can raise a NotImplementedError

anmyachev
anmyachev previously approved these changes Nov 20, 2023
Copy link
Collaborator

@anmyachev anmyachev left a comment

Choose a reason for hiding this comment

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

LGTM!

Signed-off-by: Dmitry Chigarev <dmitry.chigarev@intel.com>
Copy link
Collaborator

@anmyachev anmyachev left a comment

Choose a reason for hiding this comment

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

LGTM!


# test that 'ModinDtypes.concat' with duplicated labels raises when not all dtypes are materialized
with pytest.raises(NotImplementedError):
res = ModinDtypes.concat(

Check notice

Code scanning / CodeQL

Unused local variable

Variable res is not used.
@anmyachev anmyachev merged commit 0ba2a46 into modin-project:master Nov 20, 2023
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.

Preserve partial dtype for the result of .reset_index()
2 participants