Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CHORE] Concretize casting semantics for temporal + decimal types (#2798
) Closes: #1173 This PR makes the casting logic for temporal + decimal types more strict and transparent. All target datatypes for casting is now contained in the `.cast` method, removing the catch all branch which allowed casting via the underlying physical type, e.g. you used to be able to cast a Duration to a Timestamp by simply casting the underlying I64 array to a timestamp array. Additionally, this PR removes the `arrow_logical_cast` function, which was essentially used for two things: 1. casting temporal types to the same temporal type, but with different timeunit / timezone, 2. casting decimals to anything else. Now, the logic for same type different timeunit / timezone casting is built into Daft, instead of using Arrow2. The decimal to decimal logic, however, is still via Arrow2 (as it is more complex and will require it's own PR). Nevertheless, the code is much cleaner and easier to understand. NOTE: This PR is a breaking change, as it will likely reduce the number of possible cast targets for these types. --------- Co-authored-by: Colin Ho <[email protected]> Co-authored-by: Colin Ho <[email protected]>
- Loading branch information