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

Bug casting from uint pdarray to strings/float #2644

Closed
stress-tess opened this issue Aug 7, 2023 · 0 comments · Fixed by #2745
Closed

Bug casting from uint pdarray to strings/float #2644

stress-tess opened this issue Aug 7, 2023 · 0 comments · Fixed by #2745
Assignees
Labels
bug Something isn't working

Comments

@stress-tess
Copy link
Member

stress-tess commented Aug 7, 2023

We currently don't have the ability to cast from a uint pdarray to a strings. I found this while reviewing the pdarray_creation_tests PR

# int pdarray converts just fine
>>> ak.cast(ak.arange(10), str)
array(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'])

# uint pdarray causes errors
>>> ak.cast(ak.arange(10, dtype=ak.uint64), str)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[12], line 1
----> 1 ak.cast(ak.arange(10, dtype=ak.uint64), str)

RuntimeError: Error: castMsg: UInt64 : str not implemented

The issue seems to be this block. For all other types we do "str" not "string"

arkouda/src/CastMsg.chpl

Lines 85 to 87 in 5eb7b5f

when (DType.UInt64, "string") {
return new MsgTuple(castGenSymEntryToString(gse, st, uint), MsgType.NORMAL);
}

Similarly we can't cast from uint to float because we write "float" instead "float64"

@stress-tess stress-tess added the bug Something isn't working label Aug 7, 2023
@stress-tess stress-tess self-assigned this Aug 7, 2023
@stress-tess stress-tess changed the title Bug casting from uint pdarray to strings Bug casting from uint pdarray to strings/float Sep 1, 2023
stress-tess pushed a commit to stress-tess/arkouda that referenced this issue Sep 1, 2023
…d add str cast to str

This PR (fixes Bears-R-Us#2644 and fixes Bears-R-Us#2645) fixes uint casting to str and float and adds casting from str to str
stress-tess pushed a commit to stress-tess/arkouda that referenced this issue Sep 1, 2023
…d add str cast to str

This PR (fixes Bears-R-Us#2644 and fixes Bears-R-Us#2645) fixes uint casting to str and float and adds casting from str to str
stress-tess pushed a commit to stress-tess/arkouda that referenced this issue Sep 1, 2023
…d add str cast to str

This PR (fixes Bears-R-Us#2644 and fixes Bears-R-Us#2645) fixes uint casting to str and float and adds casting from str to str
github-merge-queue bot pushed a commit that referenced this issue Sep 6, 2023
#2745)

This PR (fixes #2644 and fixes #2645) fixes uint casting to str and float and adds casting from str to str

Co-authored-by: Pierce Hayes <pierce314159@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant