-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat(python): add head/tail under string namespace #10339
Conversation
Following the discussion in the linked issue:
Do you think the docstrings should specify what exactly a "character" is? |
@avimallu perhaps, yes. We don't current for |
Okay @mcrumiller. The average person (ala me) isn't probably familiar with codepoints, but it is an important distinction to be aware of. Maybe to avoid confusion for the unfamiliar folks, while simultaneously providing enough info to the ones looking for it:
Replace UTF8 code points with what is technically accurate? |
|
||
Returns | ||
------- | ||
Expr | ||
Expression of data type :class:`Utf8`. | ||
|
||
Notes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also added this note to both the str and expr docstrings for slice
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without it it's technically not correct. You can also call it a Unicode Scalar Value like the Rust docs if you prefer.
This should still support negative arguments as we discussed. |
@orlp I'm working on. I'm still pretty new to rust and haven't really internalized most of the concepts. pyarrow2's string slicing only operates on a fixed input length so I have to unpack the pyarrow array and apply this to the elements inside, and I'm still trying to figure out how to do that. I may post a non-working commit and ask for some assistance. |
@mcrumiller I understand, I commented more in case someone else wanted to review/merge in the current state. |
GitHub has a "draft" feature you can use while your work is in progress. I went ahead and clicked the button for you 😸 |
That is a useful feature, thank you @stinodego ! |
I'm going to close and start from scratch rather than trying to revive this ancient PR. |
Resolves #10337 and #10349
There is some discussion on the naming of the functions.