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

Ensure cudf.Series(cudf.Series(...)) creates a reference to the same index #15845

Merged

Conversation

mroeschke
Copy link
Contributor

Description

Aligns these behaviors

In [1]: import pandas as pd

In [3]: ser1 = pd.Series(range(3), index=list("Abc"))

In [4]: ser2 = pd.Series(ser1)

In [5]: ser1.index is ser2.index
Out[5]: True

In [6]: import cudf

In [7]: ser1 = cudf.Series(range(3), index=list("Abc"))

In [8]: ser2 = cudf.Series(ser1)

In [9]: ser1.index is ser2.index
Out[9]: False

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@mroeschke mroeschke added Python Affects Python cuDF API. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels May 23, 2024
@mroeschke mroeschke requested a review from a team as a code owner May 23, 2024 21:53
@mroeschke mroeschke requested review from vyasr and galipremsagar May 23, 2024 21:53
Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

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

Approving the change, but the title is a bit misleading. When I read it I assumed that instead of shallow copying you wanted to deep copy, but in fact we're going the opposite direction. Since the title goes in the changelog, maybe something like "Ensure cudf.Series(cudf.Series(...)) creates a reference to the same index" is more apt?

@mroeschke mroeschke changed the title Ensure cudf.Series(cudf.Series(...)) doesn't shallow copy index Ensure cudf.Series(cudf.Series(...)) creates a reference to the same index May 23, 2024
@mroeschke
Copy link
Contributor Author

"Ensure cudf.Series(cudf.Series(...)) creates a reference to the same index" is more apt?

Yup sounds good!

@galipremsagar
Copy link
Contributor

/merge

@rapids-bot rapids-bot bot merged commit 72aa271 into rapidsai:branch-24.08 May 24, 2024
70 checks passed
@mroeschke mroeschke deleted the bug/no_shallow_copy/series branch May 24, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants