-
Notifications
You must be signed in to change notification settings - Fork 79
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
Incorrect conversion of pyarrow interval value to datafusion literal #665
Comments
It's probably related to this issue in arrow-rs: Rust Interval definition is incorrect. Here's a godbolt link demonstrating the "1 month becomes 1 nanosecond" example. (I based that on a comment in a similar thread in duckdb-wasm). I would suspect that if all code paths use the same impl, then The error occurs in the pyo3 magic as we cross the python side: datafusion-python/datafusion/__init__.py Lines 182 to 185 in 67d4cfb
rust side: Lines 229 to 232 in 67d4cfb
The error is already present before the rust-method is invoked, adding print statements on both sides of the bridge: converting: MonthDayNano(months=1, days=0, nanoseconds=0)
converting: IntervalMonthDayNano("1") |
TODO: If the PR #666 merges in before this issues is corrected, the following examples in the
|
Describe the bug
When creating a literal interval value from a pyarrow scalar, the values for month, day, and nanoseconds are not correctly assigned in the literal values. The following minimal example will reproduce. This appears to be limited to
datafusion-python
and not the rust implementation.To Reproduce
Produces the following result:
Expected behavior
When setting an interval value of 1 month in pyarrow, it should show up as 1 month in the datafusion data frame, and so on for the other values.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: