Skip to content

Casting strings removes the length parameter? #4578

Closed Answered by cpcloud
kesmit13 asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for opening an issue.

This behavior is ... interesting.

Ibis throws away the length parameter, because up until this discussion there are no string APIs (or generic APIs like .cast that use strings) where the length matters. All of our backends handle variable length strings so it didn't seem worth it to have another string type.

I don't think this behavior is enough to justify adding a whole new type, but you can special case the ops.Cast translation and look at the operation's output_dtype attribute as well as the input dtypes and choose your desired cast code.

Would that work for you?

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by kesmit13
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants