Skip to content

Commit 4cf0179

Browse files
update API for logical expr Limit
Ref: apache/datafusion#12836
1 parent b851136 commit 4cf0179

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

python/tests/test_expr.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,18 @@ def test_limit(test_ctx):
8585

8686
plan = plan.to_variant()
8787
assert isinstance(plan, Limit)
88-
assert plan.skip() == 0
88+
# TODO: Upstream now has expressions for skip and fetch
89+
# REF: https://github.com/apache/datafusion/pull/12836
90+
# assert plan.skip() == 0
8991

9092
df = test_ctx.sql("select c1 from test LIMIT 10 OFFSET 5")
9193
plan = df.logical_plan()
9294

9395
plan = plan.to_variant()
9496
assert isinstance(plan, Limit)
95-
assert plan.skip() == 5
97+
# TODO: Upstream now has expressions for skip and fetch
98+
# REF: https://github.com/apache/datafusion/pull/12836
99+
# assert plan.skip() == 5
96100

97101

98102
def test_aggregate_query(test_ctx):

src/expr/limit.rs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl Display for PyLimit {
4646
write!(
4747
f,
4848
"Limit
49-
Skip: {}
49+
Skip: {:?}
5050
Fetch: {:?}
5151
Input: {:?}",
5252
&self.limit.skip, &self.limit.fetch, &self.limit.input
@@ -56,15 +56,19 @@ impl Display for PyLimit {
5656

5757
#[pymethods]
5858
impl PyLimit {
59-
/// Retrieves the skip value for this `Limit`
60-
fn skip(&self) -> usize {
61-
self.limit.skip
62-
}
59+
// NOTE: Upstream now has expressions for skip and fetch
60+
// TODO: Do we still want to expose these?
61+
// REF: https://github.com/apache/datafusion/pull/12836
6362

64-
/// Retrieves the fetch value for this `Limit`
65-
fn fetch(&self) -> Option<usize> {
66-
self.limit.fetch
67-
}
63+
// /// Retrieves the skip value for this `Limit`
64+
// fn skip(&self) -> usize {
65+
// self.limit.skip
66+
// }
67+
68+
// /// Retrieves the fetch value for this `Limit`
69+
// fn fetch(&self) -> Option<usize> {
70+
// self.limit.fetch
71+
// }
6872

6973
/// Retrieves the input `LogicalPlan` to this `Limit` node
7074
fn input(&self) -> PyResult<Vec<PyLogicalPlan>> {

0 commit comments

Comments
 (0)