pub struct PyExpr {
    pub expr: Expr,
}
Expand description

A PyExpr that can be used on a DataFrame

Fields§

§expr: Expr

Implementations§

source§

impl PyExpr

source

pub fn literal(value: ScalarValue) -> PyExpr

source

pub fn column(value: &str) -> PyExpr

source

pub fn alias(&self, name: &str) -> PyExpr

assign a name to the PyExpr

source

pub fn sort(&self, ascending: bool, nulls_first: bool) -> PyExpr

Create a sort PyExpr from an existing PyExpr.

source

pub fn is_null(&self) -> PyExpr

source

pub fn cast(&self, to: PyArrowType<DataType>) -> PyExpr

source

pub fn rex_type(&self) -> PyResult<RexType>

A Rex (Row Expression) specifies a single row of data. That specification could include user defined functions or types. RexType identifies the row as one of the possible valid RexTypes.

source

pub fn types(&self) -> PyResult<DataTypeMap>

Given the current Expr return the DataTypeMap which represents the PythonType, Arrow DataType, and SqlType Enum which represents

source

pub fn python_value(&self, py: Python<'_>) -> PyResult<PyObject>

Extracts the Expr value into a PyObject that can be shared with Python

source

pub fn rex_call_operands(&self) -> PyResult<Vec<PyExpr>>

Row expressions, Rex(s), operate on the concept of operands. Different variants of Expressions, Expr(s), store those operands in different datastructures. This function examines the Expr variant and returns the operands to the calling logic as a Vec of PyExpr instances.

source

pub fn rex_call_operator(&self) -> PyResult<String>

Extracts the operator associated with a RexType::Call

source

pub fn column_name(&self, plan: PyLogicalPlan) -> PyResult<String>

source§

impl PyExpr

source

pub fn _column_name( &self, plan: &LogicalPlan ) -> Result<String, DataFusionError>

source

pub fn expr_to_field( expr: &Expr, input_plan: &LogicalPlan ) -> Result<DFField, DataFusionError>

Create a DFField representing an Expr, given an input LogicalPlan to resolve against

Trait Implementations§

source§

impl Clone for PyExpr

source§

fn clone(&self) -> PyExpr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PyExpr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Expr> for PyExpr

source§

fn from(expr: Expr) -> PyExpr

Converts to this type from the input type.
source§

impl From<PyExpr> for Expr

source§

fn from(expr: PyExpr) -> Expr

Converts to this type from the input type.
source§

impl IntoPy<Py<PyAny>> for PyExpr

source§

fn into_py(self, py: Python<'_>) -> PyObject

Performs the conversion.
source§

impl PyClass for PyExpr

§

type Frozen = False

Whether the pyclass is frozen. Read more
source§

impl PyClassImpl for PyExpr

source§

const IS_BASETYPE: bool = true

#[pyclass(subclass)]
source§

const IS_SUBCLASS: bool = false

#[pyclass(extends=…)]
source§

const IS_MAPPING: bool = false

#[pyclass(mapping)]
source§

const IS_SEQUENCE: bool = false

#[pyclass(sequence)]
§

type Layout = PyCell<PyExpr>

Layout
§

type BaseType = PyAny

Base class
§

type ThreadChecker = ThreadCheckerStub<PyExpr>

This handles following two situations: Read more
§

type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild

Immutable or mutable
§

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.
§

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.
§

type BaseNativeType = PyAny

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict.
source§

fn items_iter() -> PyClassItemsIter

source§

fn doc(py: Python<'_>) -> PyResult<&'static CStr>

Rendered class doc
source§

fn lazy_type_object() -> &'static LazyTypeObject<Self>

source§

fn dict_offset() -> Option<isize>

source§

fn weaklist_offset() -> Option<isize>

source§

impl PyClass__add__SlotFragment<PyExpr> for PyClassImplCollector<PyExpr>

source§

unsafe fn __add__( self, py: Python<'_>, _raw_slf: *mut PyObject, arg0: *mut PyObject ) -> PyResult<*mut PyObject>

Safety: _slf and _other must be valid non-null Python objects Read more
source§

impl PyClass__and__SlotFragment<PyExpr> for PyClassImplCollector<PyExpr>

source§

unsafe fn __and__( self, py: Python<'_>, _raw_slf: *mut PyObject, arg0: *mut PyObject ) -> PyResult<*mut PyObject>

Safety: _slf and _other must be valid non-null Python objects Read more
source§

impl PyClass__mod__SlotFragment<PyExpr> for PyClassImplCollector<PyExpr>

source§

unsafe fn __mod__( self, py: Python<'_>, _raw_slf: *mut PyObject, arg0: *mut PyObject ) -> PyResult<*mut PyObject>

Safety: _slf and _other must be valid non-null Python objects Read more
source§

impl PyClass__mul__SlotFragment<PyExpr> for PyClassImplCollector<PyExpr>

source§

unsafe fn __mul__( self, py: Python<'_>, _raw_slf: *mut PyObject, arg0: *mut PyObject ) -> PyResult<*mut PyObject>

Safety: _slf and _other must be valid non-null Python objects Read more
source§

impl PyClass__or__SlotFragment<PyExpr> for PyClassImplCollector<PyExpr>

source§

unsafe fn __or__( self, py: Python<'_>, _raw_slf: *mut PyObject, arg0: *mut PyObject ) -> PyResult<*mut PyObject>

Safety: _slf and _other must be valid non-null Python objects Read more
source§

impl PyClass__sub__SlotFragment<PyExpr> for PyClassImplCollector<PyExpr>

source§

unsafe fn __sub__( self, py: Python<'_>, _raw_slf: *mut PyObject, arg0: *mut PyObject ) -> PyResult<*mut PyObject>

Safety: _slf and _other must be valid non-null Python objects Read more
source§

impl PyClass__truediv__SlotFragment<PyExpr> for PyClassImplCollector<PyExpr>

source§

unsafe fn __truediv__( self, py: Python<'_>, _raw_slf: *mut PyObject, arg0: *mut PyObject ) -> PyResult<*mut PyObject>

Safety: _slf and _other must be valid non-null Python objects Read more
source§

impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyExpr

§

type Holder = Option<PyRef<'py, PyExpr>>

source§

fn extract(obj: &'py PyAny, holder: &'a mut Self::Holder) -> PyResult<Self>

source§

impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut PyExpr

§

type Holder = Option<PyRefMut<'py, PyExpr>>

source§

fn extract(obj: &'py PyAny, holder: &'a mut Self::Holder) -> PyResult<Self>

source§

impl PyMethods<PyExpr> for PyClassImplCollector<PyExpr>

source§

fn py_methods(self) -> &'static PyClassItems

source§

impl PyTypeInfo for PyExpr

§

type AsRefTarget = PyCell<PyExpr>

Utility type to make Py::as_ref work.
source§

const NAME: &'static str = _

Class name.
source§

const MODULE: Option<&'static str> = _

Module name, if any.
source§

fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject

Returns the PyTypeObject instance for this type.
source§

fn type_object(py: Python<'_>) -> &PyType

Returns the safe abstraction over the type object.
source§

fn is_type_of(object: &PyAny) -> bool

Checks if object is an instance of this type or a subclass of this type.
source§

fn is_exact_type_of(object: &PyAny) -> bool

Checks if object is an instance of this type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for PyExpr

§

impl Send for PyExpr

§

impl Sync for PyExpr

§

impl Unpin for PyExpr

§

impl !UnwindSafe for PyExpr

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<'a, T> FromPyObject<'a> for Twhere T: PyClass + Clone,

source§

fn extract(obj: &'a PyAny) -> Result<T, PyErr>

Extracts Self from the source PyObject.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> OkWrap<T> for Twhere T: IntoPy<Py<PyAny>>,

§

type Error = PyErr

source§

fn wrap(self, py: Python<'_>) -> Result<Py<PyAny>, PyErr>

source§

impl<T> PyErrArguments for Twhere T: IntoPy<Py<PyAny>> + Send + Sync,

source§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> Ungil for Twhere T: Send,