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

Clean up special casing in as_column for non-typed input #15276

Merged
merged 21 commits into from
Apr 17, 2024

Conversation

mroeschke
Copy link
Contributor

@mroeschke mroeschke commented Mar 12, 2024

Description

Redo at #14636

Clean up special casing for non-typed inputs to essentially do:

try:
     arbitrary = pa.array(arbitrary)
except:
     arbitrary = pd.Series(arbitrary)
return as_column(arbitrary)

Additionally, this change matches a behavior with pandas that will parse string data with dtype=datetime64 type similar to the 2.2 behavior (fail if the resolution of the type doesn't match the string data)

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 Mar 12, 2024
@mroeschke mroeschke requested a review from a team as a code owner March 12, 2024 00:55
@mroeschke mroeschke changed the base branch from branch-24.04 to branch-24.06 March 18, 2024 22:06
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.

A few questions to make sure that I followed everything. Thanks so much for this! Anything to simplify as_column is amazing work.

python/cudf/cudf/core/column/column.py Show resolved Hide resolved
python/cudf/cudf/core/column/column.py Show resolved Hide resolved
python/cudf/cudf/core/column/column.py Show resolved Hide resolved
python/cudf/cudf/core/column/column.py Show resolved Hide resolved
python/cudf/cudf/core/column/column.py Show resolved Hide resolved
python/cudf/cudf/core/column/column.py Show resolved Hide resolved
python/cudf/cudf/core/index.py Show resolved Hide resolved
@mroeschke
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit e928c4a into rapidsai:branch-24.06 Apr 17, 2024
70 checks passed
@mroeschke mroeschke deleted the ref/as_columns/misc branch April 17, 2024 19:17
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
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants