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

Correct return type for initcap scalar function with utf8view #13909

Merged
merged 3 commits into from
Dec 27, 2024

Conversation

timsaucer
Copy link
Contributor

@timsaucer timsaucer commented Dec 26, 2024

Which issue does this PR close?

Closes #13907

Rationale for this change

Described in the issue, when the input type is utf8view for initcap, so should the return type. The actual return type is utf8view, so we just need to set it in the return_type function to match.

What changes are included in this PR?

One change to return_type function

Are these changes tested?

Tested in datafusion-python unit tests. I also updated the unit test macro to validate that data types returned from scalar functions matches those that are expected, which is why this problem was not identified previously.

Are there any user-facing changes?

None

@timsaucer timsaucer marked this pull request as ready for review December 26, 2024 20:28
@timsaucer timsaucer changed the title Set utf8view as return type when input type is the same Correct return type for initcap scalar function with utf8view Dec 26, 2024
Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @timsaucer

@jonahgao jonahgao merged commit 9665e09 into apache:main Dec 27, 2024
28 checks passed
@timsaucer timsaucer mentioned this pull request Dec 27, 2024
10 tasks
alamb pushed a commit to alamb/datafusion that referenced this pull request Dec 28, 2024
…#13909)

* Set utf8view as return type when input type is the same

* Verify that the returned type from call to scalar function matches the return type specified in the return_type function

* Match return type to utf8view
alamb added a commit that referenced this pull request Dec 28, 2024
#13934)

* Set utf8view as return type when input type is the same

* Verify that the returned type from call to scalar function matches the return type specified in the return_type function

* Match return type to utf8view

Co-authored-by: Tim Saucer <timsaucer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

initcap function expected return type does not match actual
3 participants