TypeError("'PyExpr' object cannot be converted to 'PyExpr'") #2855
-
There is a
and then run this script in rust with
I run this newly added test within
It looks like I do got an obj named |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
I suspect that you installed polars and your own code as separate extension? If so, then you most likely hit a fundamental limitation of how PyO3 currently works. The type objects backing Note that while the statically stored type objects are the current blocker, this whole issue not easy to resolve due to the lack of ABI stability for Rust generally. I.e. even if your extension and the polars extension were able to share type objects, accessing Rust internals of another extension could only work if they were both built with the exact same compiler in the first place. As to what you can do about it: Usually the best course of action is to treat these objects as ordinary Python objects and ignore their Rust internals and work with them using their Python API via |
Beta Was this translation helpful? Give feedback.
I suspect that you installed polars and your own code as separate extension? If so, then you most likely hit a fundamental limitation of how PyO3 currently works. The type objects backing
#[pyclass]
are stored asstatic
s. Hence, each extension built using PyO3 has their own type objects and specifically the type object backingPyExpr
in your extension and in the prebuilt polar extension you installed are equal but not identical which explain the strange error message you are getting.Note that while the statically stored type objects are the current blocker, this whole issue not easy to resolve due to the lack of ABI stability for Rust generally. I.e. even if your extension and the polars…