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

Support cast between Durations + between Durations all numeric types #6452

Merged
merged 7 commits into from
Sep 26, 2024

Conversation

tisonkun
Copy link
Member

Which issue does this PR close?

This resolves #6425.

Rationale for this change

Durations are represent by i64. They can be casted from/to each other just like Timestamps.

What changes are included in this PR?

Support cast between Durations. And catch up support cast between Durations and all numeric type.

Are there any user-facing changes?

Not quite. Users would found new reasonable cast supported, nothing works currently changed.

@github-actions github-actions bot added the arrow Changes to the arrow crate label Sep 25, 2024
@tisonkun tisonkun changed the title Cast durations Support cast between Durations + between Durations all numeric types Sep 25, 2024
@tisonkun
Copy link
Member Author

tisonkun commented Sep 25, 2024

cc @alamb @tustvold Here is the patch.

I'm finding where I can add some tests. If you can point me out it would be quite helpful ..

UPDATE: Added test_cast_between_durations.

@tisonkun
Copy link
Member Author

CI failure seems exist to master also. Likely unrelated to this patch ..

@alamb
Copy link
Contributor

alamb commented Sep 25, 2024

CI failure seems exist to master also. Likely unrelated to this patch ..

I believe it is #6448 which was subsequently fixed

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @tisonkun -- this looks very nice 🙏

I think this PR just needs a few more tests and it will be good to merge

arrow-cast/src/cast/mod.rs Outdated Show resolved Hide resolved
Signed-off-by: tison <[email protected]>
@tisonkun tisonkun requested a review from alamb September 25, 2024 19:34
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks great to me -- thank you @tisonkun

Copy link
Member

@waynexia waynexia left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks @tisonkun

@waynexia waynexia merged commit 2881dbe into apache:master Sep 26, 2024
26 checks passed
@tisonkun tisonkun deleted the cast-durations branch September 26, 2024 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants