Skip to content

Commit c334c70

Browse files
authored
fix(python): Use strings to expose ClosedInterval in expr IR (#16369)
1 parent 233386b commit c334c70

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

py-polars/src/lazyframe/visitor/expr_nodes.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,13 @@ pub struct Literal {
3636
dtype: PyObject,
3737
}
3838

39-
#[pyclass(name = "ClosedInterval")]
40-
#[derive(Copy, Clone)]
41-
pub enum PyClosedInterval {
42-
Both,
43-
Left,
44-
Right,
45-
None,
46-
}
47-
4839
impl IntoPy<PyObject> for Wrap<ClosedInterval> {
4940
fn into_py(self, py: Python<'_>) -> PyObject {
5041
match self.0 {
51-
ClosedInterval::Both => PyClosedInterval::Both,
52-
ClosedInterval::Left => PyClosedInterval::Left,
53-
ClosedInterval::Right => PyClosedInterval::Right,
54-
ClosedInterval::None => PyClosedInterval::None,
42+
ClosedInterval::Both => "both",
43+
ClosedInterval::Left => "left",
44+
ClosedInterval::Right => "right",
45+
ClosedInterval::None => "none",
5546
}
5647
.into_py(py)
5748
}

py-polars/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ fn _expr_nodes(_py: Python, m: &Bound<PyModule>) -> PyResult<()> {
107107
m.add_class::<PyOperator>().unwrap();
108108
m.add_class::<PyStringFunction>().unwrap();
109109
m.add_class::<PyBooleanFunction>().unwrap();
110-
m.add_class::<PyClosedInterval>().unwrap();
111110
// Options
112111
m.add_class::<PyWindowMapping>().unwrap();
113112
m.add_class::<PyRollingGroupOptions>().unwrap();

0 commit comments

Comments
 (0)