Coder Social home page Coder Social logo

Comments (2)

timsaucer avatar timsaucer commented on August 12, 2024 1

TODO: If the PR #666 merges in before this issues is corrected, the following examples in the examples/tpch folder will need to be updated

  • q01_pricing_summary_report.py
  • q04_order_priority_checking.py
  • q05_local_supplier_volume.py
  • q06_forecasting_revenue_change.py
  • q10_returned_item_reporting.py
  • q12_ship_mode_order_priority.py
  • q14_promotion_effect.py
  • q15_top_supplier.py
  • q20_potential_part_promotion.py

from datafusion-python.

Michael-J-Ward avatar Michael-J-Ward commented on August 12, 2024

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 datafusion-python wouldn't notice it, but perhaps that's wrong, or maybe not all code-paths use arrow-rs?

The error occurs in the pyo3 magic as we cross the python -> rust bridge. Notice the python side assert's pyarrow.Scalar, but then the rust-side receives a datafusion::ScalarValue. (aside: is this magic type conversion intentional?)

python side:

def literal(value):
if not isinstance(value, pa.Scalar):
value = pa.scalar(value)
return Expr.literal(value)

rust side:

#[staticmethod]
pub fn literal(value: ScalarValue) -> PyExpr {
lit(value).into()
}

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")

from datafusion-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.