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

[FEA] Implicit typecasting between Decimal and Floats during concat #8264

Closed
ayushdg opened this issue May 17, 2021 · 0 comments · Fixed by #8276
Closed

[FEA] Implicit typecasting between Decimal and Floats during concat #8264

ayushdg opened this issue May 17, 2021 · 0 comments · Fixed by #8276
Assignees
Labels
feature request New feature or request

Comments

@ayushdg
Copy link
Member

ayushdg commented May 17, 2021

Is your feature request related to a problem? Please describe.
Concat automatically handles typecasting between to decimal columns to decide the precision and scale of the output resulting decimal column during concat. There is implicit typecasting between other numeric column types as well (float32/64 and ints). However it isn't possible to concat between float and decimal columns in a dataframe.

Describe the solution you'd like

df1['a'] = range(10)
df1['b'] = 1.234
df1.b = df1['b'].astype(Decimal64Dtype(7,2))

df2['b'] = range(10)
df2['a'] = 1.234
cudf.concat([df1, df2])

ValueError: All columns must be the same type

df1['a'] = range(10)
df1['b'] = 1.234
df1.b = df1['b'].astype("float32")

df2['b'] = range(10)
df2['a'] = 1.234
cudf.concat([df1, df2])
# Works

Describe alternatives you've considered
Alternative is to cast explicitly before concat

Additional context
N/A

@ayushdg ayushdg added feature request New feature or request Needs Triage Need team to review and classify labels May 17, 2021
rapids-bot bot pushed a commit that referenced this issue May 23, 2021
This enables implicit casting when decimal columns are concatenated with numeric columns by casting the numeric columns to decimal columns.

Closes #8264

Authors:
  - https://github.com/ChrisJar

Approvers:
  - Ashwin Srinath (https://github.com/shwina)
  - https://github.com/brandon-b-miller

URL: #8276
@bdice bdice removed the Needs Triage Need team to review and classify label Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants