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-#6753: Preserve dtypes cache on '.__setitem__()' #6758

Merged
merged 4 commits into from
Nov 21, 2023

Conversation

dchigarev
Copy link
Collaborator

@dchigarev dchigarev commented Nov 20, 2023

What do these changes do?

Detect the value's dtype and insert in into partial dtypes for the result of .setitem()

  • 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 dtypes cache on df[existing_col] = scalar #6753
  • tests added and passing
  • module layout described at docs/development/architecture.rst is up-to-date

@dchigarev dchigarev marked this pull request as ready for review November 20, 2023 16:51
Comment on lines 2916 to 2921
if hasattr(value, "dtype"):
value_dtype = value.dtype
elif is_scalar(value):
value_dtype = np.dtype(type(value))
else:
value_dtype = np.array(value).dtype
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's probably better to move this into a separate function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will move for both .insert() and __setitem() after one of these PRs will be merged (#6757, #6758)

Copy link
Collaborator

Choose a reason for hiding this comment

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

#6757 is merged

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!

anmyachev
anmyachev previously approved these changes Nov 21, 2023
@anmyachev
Copy link
Collaborator

@dchigarev CI is failed. Some problems with imports.

Signed-off-by: Dmitry Chigarev <[email protected]>
@anmyachev anmyachev merged commit ed2e67b into modin-project:master Nov 21, 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 dtypes cache on df[existing_col] = scalar
2 participants