File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,12 @@ def _map(_, op):
123
123
)
124
124
125
125
126
+ def _nth_value (t , op ):
127
+ if not isinstance (nth := op .nth , ops .Literal ):
128
+ raise TypeError (f"`nth` argument must be a literal Python int, got { type (nth )} " )
129
+ return sa .func .nth_value (t .translate (op .arg ), nth .value + 1 )
130
+
131
+
126
132
_TIMESTAMP_UNITS_TO_SCALE = {"s" : 0 , "ms" : 3 , "us" : 6 , "ns" : 9 }
127
133
128
134
_SF_POS_INF = sa .func .to_double ("Inf" )
@@ -241,6 +247,7 @@ def _map(_, op):
241
247
sa .func .parse_json (sa .func .get (t .translate (op .arg ), op .field )),
242
248
t .get_sqla_type (op .output_dtype ),
243
249
),
250
+ ops .NthValue : _nth_value ,
244
251
}
245
252
)
246
253
@@ -250,7 +257,6 @@ def _map(_, op):
250
257
ops .CumulativeAny ,
251
258
ops .CumulativeOp ,
252
259
ops .NTile ,
253
- ops .NthValue ,
254
260
# ibis.expr.operations.array
255
261
ops .ArrayRepeat ,
256
262
ops .Unnest ,
You can’t perform that action at this time.
0 commit comments