polars-df 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -1
  3. data/Cargo.lock +486 -380
  4. data/Cargo.toml +0 -2
  5. data/README.md +31 -2
  6. data/ext/polars/Cargo.toml +10 -4
  7. data/ext/polars/src/apply/dataframe.rs +2 -2
  8. data/ext/polars/src/{lazy/apply.rs → apply/lazy.rs} +1 -2
  9. data/ext/polars/src/apply/mod.rs +1 -0
  10. data/ext/polars/src/batched_csv.rs +36 -19
  11. data/ext/polars/src/conversion.rs +159 -16
  12. data/ext/polars/src/dataframe.rs +51 -52
  13. data/ext/polars/src/error.rs +0 -4
  14. data/ext/polars/src/expr/binary.rs +69 -0
  15. data/ext/polars/src/expr/categorical.rs +10 -0
  16. data/ext/polars/src/expr/datetime.rs +223 -0
  17. data/ext/polars/src/{lazy/dsl.rs → expr/general.rs} +22 -799
  18. data/ext/polars/src/expr/list.rs +146 -0
  19. data/ext/polars/src/{lazy → expr}/meta.rs +16 -6
  20. data/ext/polars/src/expr/string.rs +313 -0
  21. data/ext/polars/src/expr/struct.rs +15 -0
  22. data/ext/polars/src/expr.rs +33 -0
  23. data/ext/polars/src/functions/eager.rs +93 -0
  24. data/ext/polars/src/functions/io.rs +34 -0
  25. data/ext/polars/src/functions/lazy.rs +209 -0
  26. data/ext/polars/src/functions/meta.rs +8 -0
  27. data/ext/polars/src/functions/mod.rs +5 -0
  28. data/ext/polars/src/functions/whenthen.rs +43 -0
  29. data/ext/polars/src/{lazy/dataframe.rs → lazyframe.rs} +58 -45
  30. data/ext/polars/src/lazygroupby.rs +29 -0
  31. data/ext/polars/src/lib.rs +216 -300
  32. data/ext/polars/src/rb_modules.rs +8 -0
  33. data/ext/polars/src/series/aggregation.rs +83 -0
  34. data/ext/polars/src/series/arithmetic.rs +88 -0
  35. data/ext/polars/src/series/comparison.rs +251 -0
  36. data/ext/polars/src/series/construction.rs +164 -0
  37. data/ext/polars/src/series.rs +103 -531
  38. data/lib/polars/batched_csv_reader.rb +1 -1
  39. data/lib/polars/binary_expr.rb +77 -0
  40. data/lib/polars/binary_name_space.rb +66 -0
  41. data/lib/polars/convert.rb +2 -2
  42. data/lib/polars/data_frame.rb +263 -87
  43. data/lib/polars/data_types.rb +6 -4
  44. data/lib/polars/date_time_expr.rb +148 -8
  45. data/lib/polars/expr.rb +78 -11
  46. data/lib/polars/io.rb +73 -62
  47. data/lib/polars/lazy_frame.rb +107 -10
  48. data/lib/polars/lazy_functions.rb +7 -3
  49. data/lib/polars/list_expr.rb +70 -21
  50. data/lib/polars/list_name_space.rb +2 -2
  51. data/lib/polars/series.rb +190 -74
  52. data/lib/polars/string_expr.rb +150 -44
  53. data/lib/polars/string_name_space.rb +4 -4
  54. data/lib/polars/struct_name_space.rb +32 -0
  55. data/lib/polars/utils.rb +51 -9
  56. data/lib/polars/version.rb +1 -1
  57. data/lib/polars.rb +4 -2
  58. metadata +29 -12
  59. data/ext/polars/src/lazy/mod.rs +0 -5
  60. data/ext/polars/src/lazy/utils.rs +0 -13
  61. data/ext/polars/src/list_construction.rs +0 -100
  62. /data/ext/polars/src/{numo.rs → series/export.rs} +0 -0
  63. /data/ext/polars/src/{set.rs → series/set_at_idx.rs} +0 -0
@@ -3,31 +3,27 @@ mod batched_csv;
3
3
  mod conversion;
4
4
  mod dataframe;
5
5
  mod error;
6
+ mod expr;
6
7
  mod file;
7
- mod lazy;
8
- mod list_construction;
9
- mod numo;
8
+ mod functions;
9
+ mod lazyframe;
10
+ mod lazygroupby;
10
11
  mod object;
11
12
  mod prelude;
12
13
  pub(crate) mod rb_modules;
13
14
  mod series;
14
- mod set;
15
15
  mod utils;
16
16
 
17
17
  use batched_csv::RbBatchedCsv;
18
18
  use conversion::*;
19
19
  use dataframe::RbDataFrame;
20
20
  use error::{RbPolarsErr, RbValueError};
21
- use file::get_file_like;
22
- use lazy::dataframe::{RbLazyFrame, RbLazyGroupBy};
23
- use lazy::dsl::{RbExpr, RbWhen, RbWhenThen};
24
- use lazy::utils::rb_exprs_to_exprs;
25
- use magnus::{define_module, function, method, prelude::*, Error, IntoValue, RArray, RHash, Value};
26
- use polars::datatypes::{DataType, TimeUnit, IDX_DTYPE};
27
- use polars::error::PolarsResult;
28
- use polars::frame::DataFrame;
29
- use polars::functions::{diag_concat_df, hor_concat_df};
30
- use polars::prelude::{ClosedWindow, Duration, DurationArgs, IntoSeries, TimeZone};
21
+ use expr::rb_exprs_to_exprs;
22
+ use expr::RbExpr;
23
+ use functions::whenthen::{RbWhen, RbWhenThen};
24
+ use lazyframe::RbLazyFrame;
25
+ use lazygroupby::RbLazyGroupBy;
26
+ use magnus::{define_module, function, method, prelude::*, Error};
31
27
  use series::RbSeries;
32
28
 
33
29
  #[cfg(target_os = "linux")]
@@ -49,22 +45,70 @@ type RbResult<T> = Result<T, Error>;
49
45
  #[magnus::init]
50
46
  fn init() -> RbResult<()> {
51
47
  let module = define_module("Polars")?;
52
- module.define_singleton_method("_dtype_cols", function!(dtype_cols, 1))?;
53
- module.define_singleton_method("_rb_duration", function!(rb_duration, 8))?;
54
- module.define_singleton_method("_concat_df", function!(concat_df, 1))?;
55
- module.define_singleton_method("_concat_lf", function!(concat_lf, 3))?;
56
- module.define_singleton_method("_diag_concat_df", function!(rb_diag_concat_df, 1))?;
57
- module.define_singleton_method("_hor_concat_df", function!(rb_hor_concat_df, 1))?;
58
- module.define_singleton_method("_concat_series", function!(concat_series, 1))?;
59
- module.define_singleton_method("_ipc_schema", function!(ipc_schema, 1))?;
60
- module.define_singleton_method("_parquet_schema", function!(parquet_schema, 1))?;
61
- module.define_singleton_method("_collect_all", function!(collect_all, 1))?;
62
- module.define_singleton_method("_rb_date_range", function!(rb_date_range, 7))?;
63
- module.define_singleton_method("_coalesce_exprs", function!(coalesce_exprs, 1))?;
64
- module.define_singleton_method("_sum_exprs", function!(sum_exprs, 1))?;
65
- module.define_singleton_method("_as_struct", function!(as_struct, 1))?;
66
- module.define_singleton_method("_arg_where", function!(arg_where, 1))?;
67
- module.define_singleton_method("_get_idx_type", function!(get_idx_type, 0))?;
48
+ module.define_singleton_method(
49
+ "_dtype_cols",
50
+ function!(crate::functions::lazy::dtype_cols2, 1),
51
+ )?;
52
+ module.define_singleton_method(
53
+ "_rb_duration",
54
+ function!(crate::functions::lazy::duration, 8),
55
+ )?;
56
+ module.define_singleton_method(
57
+ "_concat_df",
58
+ function!(crate::functions::eager::concat_df, 1),
59
+ )?;
60
+ module.define_singleton_method(
61
+ "_concat_lf",
62
+ function!(crate::functions::lazy::concat_lf, 3),
63
+ )?;
64
+ module.define_singleton_method(
65
+ "_diag_concat_df",
66
+ function!(crate::functions::eager::diag_concat_df, 1),
67
+ )?;
68
+ module.define_singleton_method(
69
+ "_hor_concat_df",
70
+ function!(crate::functions::eager::hor_concat_df, 1),
71
+ )?;
72
+ module.define_singleton_method(
73
+ "_concat_series",
74
+ function!(crate::functions::eager::concat_series, 1),
75
+ )?;
76
+ module.define_singleton_method(
77
+ "_ipc_schema",
78
+ function!(crate::functions::io::read_ipc_schema, 1),
79
+ )?;
80
+ module.define_singleton_method(
81
+ "_parquet_schema",
82
+ function!(crate::functions::io::read_parquet_schema, 1),
83
+ )?;
84
+ module.define_singleton_method(
85
+ "_collect_all",
86
+ function!(crate::functions::lazy::collect_all, 1),
87
+ )?;
88
+ module.define_singleton_method(
89
+ "_rb_date_range",
90
+ function!(crate::functions::eager::date_range, 7),
91
+ )?;
92
+ module.define_singleton_method(
93
+ "_coalesce_exprs",
94
+ function!(crate::functions::lazy::coalesce, 1),
95
+ )?;
96
+ module.define_singleton_method(
97
+ "_sum_exprs",
98
+ function!(crate::functions::lazy::sum_exprs, 1),
99
+ )?;
100
+ module.define_singleton_method(
101
+ "_as_struct",
102
+ function!(crate::functions::lazy::as_struct, 1),
103
+ )?;
104
+ module.define_singleton_method(
105
+ "_arg_where",
106
+ function!(crate::functions::lazy::arg_where, 1),
107
+ )?;
108
+ module.define_singleton_method(
109
+ "_get_idx_type",
110
+ function!(crate::functions::meta::get_idx_type, 0),
111
+ )?;
68
112
 
69
113
  let class = module.define_class("RbBatchedCsv", Default::default())?;
70
114
  class.define_singleton_method("new", function!(RbBatchedCsv::new, -1))?;
@@ -73,7 +117,7 @@ fn init() -> RbResult<()> {
73
117
  let class = module.define_class("RbDataFrame", Default::default())?;
74
118
  class.define_singleton_method("new", function!(RbDataFrame::init, 1))?;
75
119
  class.define_singleton_method("read_csv", function!(RbDataFrame::read_csv, -1))?;
76
- class.define_singleton_method("read_parquet", function!(RbDataFrame::read_parquet, 7))?;
120
+ class.define_singleton_method("read_parquet", function!(RbDataFrame::read_parquet, 9))?;
77
121
  class.define_singleton_method("read_ipc", function!(RbDataFrame::read_ipc, 6))?;
78
122
  class.define_singleton_method("read_avro", function!(RbDataFrame::read_avro, 4))?;
79
123
  class.define_singleton_method("read_hashes", function!(RbDataFrame::read_hashes, 3))?;
@@ -151,7 +195,6 @@ fn init() -> RbResult<()> {
151
195
  class.define_method("pivot_expr", method!(RbDataFrame::pivot_expr, 7))?;
152
196
  class.define_method("partition_by", method!(RbDataFrame::partition_by, 2))?;
153
197
  class.define_method("shift", method!(RbDataFrame::shift, 1))?;
154
- class.define_method("unique", method!(RbDataFrame::unique, 3))?;
155
198
  class.define_method("lazy", method!(RbDataFrame::lazy, 0))?;
156
199
  class.define_method("max", method!(RbDataFrame::max, 0))?;
157
200
  class.define_method("min", method!(RbDataFrame::min, 0))?;
@@ -210,7 +253,7 @@ fn init() -> RbResult<()> {
210
253
  class.define_method("unique_stable", method!(RbExpr::unique_stable, 0))?;
211
254
  class.define_method("first", method!(RbExpr::first, 0))?;
212
255
  class.define_method("last", method!(RbExpr::last, 0))?;
213
- class.define_method("list", method!(RbExpr::list, 0))?;
256
+ class.define_method("implode", method!(RbExpr::implode, 0))?;
214
257
  class.define_method("quantile", method!(RbExpr::quantile, 2))?;
215
258
  class.define_method("agg_groups", method!(RbExpr::agg_groups, 0))?;
216
259
  class.define_method("count", method!(RbExpr::count, 0))?;
@@ -220,7 +263,8 @@ fn init() -> RbResult<()> {
220
263
  class.define_method("cast", method!(RbExpr::cast, 2))?;
221
264
  class.define_method("sort_with", method!(RbExpr::sort_with, 2))?;
222
265
  class.define_method("arg_sort", method!(RbExpr::arg_sort, 2))?;
223
- class.define_method("top_k", method!(RbExpr::top_k, 2))?;
266
+ class.define_method("top_k", method!(RbExpr::top_k, 1))?;
267
+ class.define_method("bottom_k", method!(RbExpr::bottom_k, 1))?;
224
268
  class.define_method("arg_max", method!(RbExpr::arg_max, 0))?;
225
269
  class.define_method("arg_min", method!(RbExpr::arg_min, 0))?;
226
270
  class.define_method("search_sorted", method!(RbExpr::search_sorted, 2))?;
@@ -243,6 +287,7 @@ fn init() -> RbResult<()> {
243
287
  class.define_method("std", method!(RbExpr::std, 1))?;
244
288
  class.define_method("var", method!(RbExpr::var, 1))?;
245
289
  class.define_method("is_unique", method!(RbExpr::is_unique, 0))?;
290
+ class.define_method("approx_unique", method!(RbExpr::approx_unique, 0))?;
246
291
  class.define_method("is_first", method!(RbExpr::is_first, 0))?;
247
292
  class.define_method("explode", method!(RbExpr::explode, 0))?;
248
293
  class.define_method("take_every", method!(RbExpr::take_every, 1))?;
@@ -285,9 +330,9 @@ fn init() -> RbResult<()> {
285
330
  class.define_method("cumprod", method!(RbExpr::cumprod, 1))?;
286
331
  class.define_method("product", method!(RbExpr::product, 0))?;
287
332
  class.define_method("shrink_dtype", method!(RbExpr::shrink_dtype, 0))?;
288
- class.define_method("str_parse_date", method!(RbExpr::str_parse_date, 4))?;
289
- class.define_method("str_parse_datetime", method!(RbExpr::str_parse_datetime, 6))?;
290
- class.define_method("str_parse_time", method!(RbExpr::str_parse_time, 4))?;
333
+ class.define_method("str_parse_date", method!(RbExpr::str_to_date, 4))?;
334
+ class.define_method("str_parse_datetime", method!(RbExpr::str_to_datetime, 8))?;
335
+ class.define_method("str_parse_time", method!(RbExpr::str_to_time, 3))?;
291
336
  class.define_method("str_strip", method!(RbExpr::str_strip, 1))?;
292
337
  class.define_method("str_rstrip", method!(RbExpr::str_rstrip, 1))?;
293
338
  class.define_method("str_lstrip", method!(RbExpr::str_lstrip, 1))?;
@@ -296,7 +341,7 @@ fn init() -> RbResult<()> {
296
341
  class.define_method("str_to_lowercase", method!(RbExpr::str_to_lowercase, 0))?;
297
342
  class.define_method("str_lengths", method!(RbExpr::str_lengths, 0))?;
298
343
  class.define_method("str_n_chars", method!(RbExpr::str_n_chars, 0))?;
299
- class.define_method("str_replace", method!(RbExpr::str_replace, 3))?;
344
+ class.define_method("str_replace_n", method!(RbExpr::str_replace_n, 4))?;
300
345
  class.define_method("str_replace_all", method!(RbExpr::str_replace_all, 3))?;
301
346
  class.define_method("str_zfill", method!(RbExpr::str_zfill, 1))?;
302
347
  class.define_method("str_ljust", method!(RbExpr::str_ljust, 2))?;
@@ -304,18 +349,33 @@ fn init() -> RbResult<()> {
304
349
  class.define_method("str_contains", method!(RbExpr::str_contains, 3))?;
305
350
  class.define_method("str_ends_with", method!(RbExpr::str_ends_with, 1))?;
306
351
  class.define_method("str_starts_with", method!(RbExpr::str_starts_with, 1))?;
352
+ class.define_method("binary_contains", method!(RbExpr::bin_contains, 1))?;
353
+ class.define_method("binary_ends_with", method!(RbExpr::bin_ends_with, 1))?;
354
+ class.define_method("binary_starts_with", method!(RbExpr::bin_starts_with, 1))?;
307
355
  class.define_method("str_hex_encode", method!(RbExpr::str_hex_encode, 0))?;
308
356
  class.define_method("str_hex_decode", method!(RbExpr::str_hex_decode, 1))?;
309
357
  class.define_method("str_base64_encode", method!(RbExpr::str_base64_encode, 0))?;
310
358
  class.define_method("str_base64_decode", method!(RbExpr::str_base64_decode, 1))?;
359
+ class.define_method("str_parse_int", method!(RbExpr::str_parse_int, 2))?;
360
+ class.define_method("str_json_extract", method!(RbExpr::str_json_extract, 1))?;
361
+ class.define_method("binary_hex_encode", method!(RbExpr::bin_hex_encode, 0))?;
362
+ class.define_method("binary_hex_decode", method!(RbExpr::bin_hex_decode, 1))?;
363
+ class.define_method(
364
+ "binary_base64_encode",
365
+ method!(RbExpr::bin_base64_encode, 0),
366
+ )?;
367
+ class.define_method(
368
+ "binary_base64_decode",
369
+ method!(RbExpr::bin_base64_decode, 1),
370
+ )?;
311
371
  class.define_method(
312
372
  "str_json_path_match",
313
373
  method!(RbExpr::str_json_path_match, 1),
314
374
  )?;
315
375
  class.define_method("str_extract", method!(RbExpr::str_extract, 2))?;
316
376
  class.define_method("str_extract_all", method!(RbExpr::str_extract_all, 1))?;
317
- class.define_method("count_match", method!(RbExpr::count_match, 1))?;
318
- class.define_method("strftime", method!(RbExpr::strftime, 1))?;
377
+ class.define_method("count_match", method!(RbExpr::str_count_match, 1))?;
378
+ class.define_method("strftime", method!(RbExpr::dt_to_string, 1))?;
319
379
  class.define_method("str_split", method!(RbExpr::str_split, 1))?;
320
380
  class.define_method(
321
381
  "str_split_inclusive",
@@ -327,22 +387,27 @@ fn init() -> RbResult<()> {
327
387
  method!(RbExpr::str_split_exact_inclusive, 2),
328
388
  )?;
329
389
  class.define_method("str_splitn", method!(RbExpr::str_splitn, 2))?;
330
- class.define_method("arr_lengths", method!(RbExpr::arr_lengths, 0))?;
331
- class.define_method("arr_contains", method!(RbExpr::arr_contains, 1))?;
332
- class.define_method("year", method!(RbExpr::year, 0))?;
333
- class.define_method("iso_year", method!(RbExpr::iso_year, 0))?;
334
- class.define_method("quarter", method!(RbExpr::quarter, 0))?;
335
- class.define_method("month", method!(RbExpr::month, 0))?;
336
- class.define_method("week", method!(RbExpr::week, 0))?;
337
- class.define_method("weekday", method!(RbExpr::weekday, 0))?;
338
- class.define_method("day", method!(RbExpr::day, 0))?;
339
- class.define_method("ordinal_day", method!(RbExpr::ordinal_day, 0))?;
340
- class.define_method("hour", method!(RbExpr::hour, 0))?;
341
- class.define_method("minute", method!(RbExpr::minute, 0))?;
342
- class.define_method("second", method!(RbExpr::second, 0))?;
343
- class.define_method("millisecond", method!(RbExpr::millisecond, 0))?;
344
- class.define_method("microsecond", method!(RbExpr::microsecond, 0))?;
345
- class.define_method("nanosecond", method!(RbExpr::nanosecond, 0))?;
390
+ class.define_method("list_lengths", method!(RbExpr::list_lengths, 0))?;
391
+ class.define_method("list_contains", method!(RbExpr::list_contains, 1))?;
392
+ class.define_method("list_count_match", method!(RbExpr::list_count_match, 1))?;
393
+ class.define_method("year", method!(RbExpr::dt_year, 0))?;
394
+ class.define_method("dt_is_leap_year", method!(RbExpr::dt_is_leap_year, 0))?;
395
+ class.define_method("iso_year", method!(RbExpr::dt_iso_year, 0))?;
396
+ class.define_method("quarter", method!(RbExpr::dt_quarter, 0))?;
397
+ class.define_method("month", method!(RbExpr::dt_month, 0))?;
398
+ class.define_method("week", method!(RbExpr::dt_week, 0))?;
399
+ class.define_method("weekday", method!(RbExpr::dt_weekday, 0))?;
400
+ class.define_method("day", method!(RbExpr::dt_day, 0))?;
401
+ class.define_method("ordinal_day", method!(RbExpr::dt_ordinal_day, 0))?;
402
+ class.define_method("dt_time", method!(RbExpr::dt_time, 0))?;
403
+ class.define_method("dt_date", method!(RbExpr::dt_date, 0))?;
404
+ class.define_method("dt_datetime", method!(RbExpr::dt_datetime, 0))?;
405
+ class.define_method("hour", method!(RbExpr::dt_hour, 0))?;
406
+ class.define_method("minute", method!(RbExpr::dt_minute, 0))?;
407
+ class.define_method("second", method!(RbExpr::dt_second, 0))?;
408
+ class.define_method("millisecond", method!(RbExpr::dt_millisecond, 0))?;
409
+ class.define_method("microsecond", method!(RbExpr::dt_microsecond, 0))?;
410
+ class.define_method("nanosecond", method!(RbExpr::dt_nanosecond, 0))?;
346
411
  class.define_method("duration_days", method!(RbExpr::duration_days, 0))?;
347
412
  class.define_method("duration_hours", method!(RbExpr::duration_hours, 0))?;
348
413
  class.define_method("duration_minutes", method!(RbExpr::duration_minutes, 0))?;
@@ -359,7 +424,7 @@ fn init() -> RbResult<()> {
359
424
  "duration_milliseconds",
360
425
  method!(RbExpr::duration_milliseconds, 0),
361
426
  )?;
362
- class.define_method("timestamp", method!(RbExpr::timestamp, 1))?;
427
+ class.define_method("timestamp", method!(RbExpr::dt_timestamp, 1))?;
363
428
  class.define_method("dt_offset_by", method!(RbExpr::dt_offset_by, 1))?;
364
429
  class.define_method("dt_epoch_seconds", method!(RbExpr::dt_epoch_seconds, 0))?;
365
430
  class.define_method("dt_with_time_unit", method!(RbExpr::dt_with_time_unit, 1))?;
@@ -370,11 +435,14 @@ fn init() -> RbResult<()> {
370
435
  class.define_method("dt_cast_time_unit", method!(RbExpr::dt_cast_time_unit, 1))?;
371
436
  class.define_method(
372
437
  "dt_replace_time_zone",
373
- method!(RbExpr::dt_replace_time_zone, 1),
438
+ method!(RbExpr::dt_replace_time_zone, 2),
374
439
  )?;
375
440
  class.define_method("dt_tz_localize", method!(RbExpr::dt_tz_localize, 1))?;
376
441
  class.define_method("dt_truncate", method!(RbExpr::dt_truncate, 2))?;
442
+ class.define_method("dt_month_start", method!(RbExpr::dt_month_start, 0))?;
443
+ class.define_method("dt_month_end", method!(RbExpr::dt_month_end, 0))?;
377
444
  class.define_method("dt_round", method!(RbExpr::dt_round, 2))?;
445
+ class.define_method("dt_combine", method!(RbExpr::dt_combine, 2))?;
378
446
  class.define_method("map", method!(RbExpr::map, 3))?;
379
447
  class.define_method("dot", method!(RbExpr::dot, 1))?;
380
448
  class.define_method("reinterpret", method!(RbExpr::reinterpret, 1))?;
@@ -396,24 +464,25 @@ fn init() -> RbResult<()> {
396
464
  class.define_method("rolling_skew", method!(RbExpr::rolling_skew, 2))?;
397
465
  class.define_method("lower_bound", method!(RbExpr::lower_bound, 0))?;
398
466
  class.define_method("upper_bound", method!(RbExpr::upper_bound, 0))?;
399
- class.define_method("lst_max", method!(RbExpr::lst_max, 0))?;
400
- class.define_method("lst_min", method!(RbExpr::lst_min, 0))?;
401
- class.define_method("lst_sum", method!(RbExpr::lst_sum, 0))?;
402
- class.define_method("lst_mean", method!(RbExpr::lst_mean, 0))?;
403
- class.define_method("lst_sort", method!(RbExpr::lst_sort, 1))?;
404
- class.define_method("lst_reverse", method!(RbExpr::lst_reverse, 0))?;
405
- class.define_method("lst_unique", method!(RbExpr::lst_unique, 0))?;
406
- class.define_method("lst_get", method!(RbExpr::lst_get, 1))?;
407
- class.define_method("lst_join", method!(RbExpr::lst_join, 1))?;
408
- class.define_method("lst_arg_min", method!(RbExpr::lst_arg_min, 0))?;
409
- class.define_method("lst_arg_max", method!(RbExpr::lst_arg_max, 0))?;
410
- class.define_method("lst_diff", method!(RbExpr::lst_diff, 2))?;
411
- class.define_method("lst_shift", method!(RbExpr::lst_shift, 1))?;
412
- class.define_method("lst_slice", method!(RbExpr::lst_slice, 2))?;
413
- class.define_method("lst_eval", method!(RbExpr::lst_eval, 2))?;
467
+ class.define_method("list_max", method!(RbExpr::list_max, 0))?;
468
+ class.define_method("list_min", method!(RbExpr::list_min, 0))?;
469
+ class.define_method("list_sum", method!(RbExpr::list_sum, 0))?;
470
+ class.define_method("list_take", method!(RbExpr::list_take, 2))?;
471
+ class.define_method("list_mean", method!(RbExpr::list_mean, 0))?;
472
+ class.define_method("list_sort", method!(RbExpr::list_sort, 1))?;
473
+ class.define_method("list_reverse", method!(RbExpr::list_reverse, 0))?;
474
+ class.define_method("list_unique", method!(RbExpr::list_unique, 1))?;
475
+ class.define_method("list_get", method!(RbExpr::list_get, 1))?;
476
+ class.define_method("list_join", method!(RbExpr::list_join, 1))?;
477
+ class.define_method("list_arg_min", method!(RbExpr::list_arg_min, 0))?;
478
+ class.define_method("list_arg_max", method!(RbExpr::list_arg_max, 0))?;
479
+ class.define_method("list_diff", method!(RbExpr::list_diff, 2))?;
480
+ class.define_method("list_shift", method!(RbExpr::list_shift, 1))?;
481
+ class.define_method("list_slice", method!(RbExpr::list_slice, 2))?;
482
+ class.define_method("list_eval", method!(RbExpr::list_eval, 2))?;
414
483
  class.define_method("cumulative_eval", method!(RbExpr::cumulative_eval, 3))?;
415
- class.define_method("lst_to_struct", method!(RbExpr::lst_to_struct, 3))?;
416
- class.define_method("rank", method!(RbExpr::rank, 2))?;
484
+ class.define_method("list_to_struct", method!(RbExpr::list_to_struct, 3))?;
485
+ class.define_method("rank", method!(RbExpr::rank, 3))?;
417
486
  class.define_method("diff", method!(RbExpr::diff, 2))?;
418
487
  class.define_method("pct_change", method!(RbExpr::pct_change, 1))?;
419
488
  class.define_method("skew", method!(RbExpr::skew, 1))?;
@@ -452,31 +521,51 @@ fn init() -> RbResult<()> {
452
521
  // meta
453
522
  class.define_method("meta_pop", method!(RbExpr::meta_pop, 0))?;
454
523
  class.define_method("meta_eq", method!(RbExpr::meta_eq, 1))?;
455
- class.define_method("meta_roots", method!(RbExpr::meta_roots, 0))?;
524
+ class.define_method("meta_roots", method!(RbExpr::meta_root_names, 0))?;
456
525
  class.define_method("meta_output_name", method!(RbExpr::meta_output_name, 0))?;
457
526
  class.define_method("meta_undo_aliases", method!(RbExpr::meta_undo_aliases, 0))?;
527
+ class.define_method(
528
+ "meta_has_multiple_outputs",
529
+ method!(RbExpr::meta_has_multiple_outputs, 0),
530
+ )?;
531
+ class.define_method(
532
+ "meta_is_regex_projection",
533
+ method!(RbExpr::meta_is_regex_projection, 0),
534
+ )?;
458
535
 
459
536
  // maybe add to different class
460
- class.define_singleton_method("col", function!(crate::lazy::dsl::col, 1))?;
461
- class.define_singleton_method("count", function!(crate::lazy::dsl::count, 0))?;
462
- class.define_singleton_method("first", function!(crate::lazy::dsl::first, 0))?;
463
- class.define_singleton_method("last", function!(crate::lazy::dsl::last, 0))?;
464
- class.define_singleton_method("cols", function!(crate::lazy::dsl::cols, 1))?;
465
- class.define_singleton_method("fold", function!(crate::lazy::dsl::fold, 3))?;
466
- class.define_singleton_method("cumfold", function!(crate::lazy::dsl::cumfold, 4))?;
467
- class.define_singleton_method("lit", function!(crate::lazy::dsl::lit, 1))?;
468
- class.define_singleton_method("arange", function!(crate::lazy::dsl::arange, 3))?;
469
- class.define_singleton_method("repeat", function!(crate::lazy::dsl::repeat, 2))?;
470
- class.define_singleton_method("pearson_corr", function!(crate::lazy::dsl::pearson_corr, 3))?;
537
+ class.define_singleton_method("col", function!(crate::functions::lazy::col, 1))?;
538
+ class.define_singleton_method("count", function!(crate::functions::lazy::count, 0))?;
539
+ class.define_singleton_method("first", function!(crate::functions::lazy::first, 0))?;
540
+ class.define_singleton_method("last", function!(crate::functions::lazy::last, 0))?;
541
+ class.define_singleton_method("cols", function!(crate::functions::lazy::cols, 1))?;
542
+ class.define_singleton_method("fold", function!(crate::functions::lazy::fold, 3))?;
543
+ class.define_singleton_method("cumfold", function!(crate::functions::lazy::cumfold, 4))?;
544
+ class.define_singleton_method("lit", function!(crate::functions::lazy::lit, 1))?;
545
+ class.define_singleton_method("arange", function!(crate::functions::lazy::arange, 3))?;
546
+ class.define_singleton_method("repeat", function!(crate::functions::lazy::repeat, 2))?;
547
+ class.define_singleton_method(
548
+ "pearson_corr",
549
+ function!(crate::functions::lazy::pearson_corr, 3),
550
+ )?;
471
551
  class.define_singleton_method(
472
552
  "spearman_rank_corr",
473
- function!(crate::lazy::dsl::spearman_rank_corr, 4),
553
+ function!(crate::functions::lazy::spearman_rank_corr, 4),
554
+ )?;
555
+ class.define_singleton_method("cov", function!(crate::functions::lazy::cov, 2))?;
556
+ class.define_singleton_method(
557
+ "arg_sort_by",
558
+ function!(crate::functions::lazy::arg_sort_by, 2),
559
+ )?;
560
+ class.define_singleton_method("when", function!(crate::functions::whenthen::when, 1))?;
561
+ class.define_singleton_method(
562
+ "concat_str",
563
+ function!(crate::functions::lazy::concat_str, 2),
564
+ )?;
565
+ class.define_singleton_method(
566
+ "concat_lst",
567
+ function!(crate::functions::lazy::concat_lst, 1),
474
568
  )?;
475
- class.define_singleton_method("cov", function!(crate::lazy::dsl::cov, 2))?;
476
- class.define_singleton_method("argsort_by", function!(crate::lazy::dsl::argsort_by, 2))?;
477
- class.define_singleton_method("when", function!(crate::lazy::dsl::when, 1))?;
478
- class.define_singleton_method("concat_str", function!(crate::lazy::dsl::concat_str, 2))?;
479
- class.define_singleton_method("concat_lst", function!(crate::lazy::dsl::concat_lst, 1))?;
480
569
 
481
570
  let class = module.define_class("RbLazyFrame", Default::default())?;
482
571
  class.define_singleton_method("read_json", function!(RbLazyFrame::read_json, 1))?;
@@ -487,7 +576,7 @@ fn init() -> RbResult<()> {
487
576
  class.define_singleton_method("new_from_csv", function!(RbLazyFrame::new_from_csv, -1))?;
488
577
  class.define_singleton_method(
489
578
  "new_from_parquet",
490
- function!(RbLazyFrame::new_from_parquet, 7),
579
+ function!(RbLazyFrame::new_from_parquet, 8),
491
580
  )?;
492
581
  class.define_singleton_method("new_from_ipc", function!(RbLazyFrame::new_from_ipc, 6))?;
493
582
  class.define_method("write_json", method!(RbLazyFrame::write_json, 1))?;
@@ -504,6 +593,7 @@ fn init() -> RbResult<()> {
504
593
  class.define_method("sort_by_exprs", method!(RbLazyFrame::sort_by_exprs, 3))?;
505
594
  class.define_method("cache", method!(RbLazyFrame::cache, 0))?;
506
595
  class.define_method("collect", method!(RbLazyFrame::collect, 0))?;
596
+ class.define_method("sink_parquet", method!(RbLazyFrame::sink_parquet, 7))?;
507
597
  class.define_method("fetch", method!(RbLazyFrame::fetch, 1))?;
508
598
  class.define_method("filter", method!(RbLazyFrame::filter, 1))?;
509
599
  class.define_method("select", method!(RbLazyFrame::select, 1))?;
@@ -532,7 +622,7 @@ fn init() -> RbResult<()> {
532
622
  class.define_method("drop_nulls", method!(RbLazyFrame::drop_nulls, 1))?;
533
623
  class.define_method("slice", method!(RbLazyFrame::slice, 2))?;
534
624
  class.define_method("tail", method!(RbLazyFrame::tail, 1))?;
535
- class.define_method("melt", method!(RbLazyFrame::melt, 4))?;
625
+ class.define_method("melt", method!(RbLazyFrame::melt, 5))?;
536
626
  class.define_method("with_row_count", method!(RbLazyFrame::with_row_count, 2))?;
537
627
  class.define_method("drop_columns", method!(RbLazyFrame::drop_columns, 1))?;
538
628
  class.define_method("_clone", method!(RbLazyFrame::clone, 0))?;
@@ -559,15 +649,29 @@ fn init() -> RbResult<()> {
559
649
  class.define_singleton_method("new_opt_i64", function!(RbSeries::new_opt_i64, 3))?;
560
650
  class.define_singleton_method("new_opt_f32", function!(RbSeries::new_opt_f32, 3))?;
561
651
  class.define_singleton_method("new_opt_f64", function!(RbSeries::new_opt_f64, 3))?;
652
+ class.define_singleton_method(
653
+ "new_from_anyvalues",
654
+ function!(RbSeries::new_from_anyvalues, 3),
655
+ )?;
562
656
  class.define_singleton_method("new_str", function!(RbSeries::new_str, 3))?;
657
+ class.define_singleton_method("new_binary", function!(RbSeries::new_binary, 3))?;
658
+ class.define_singleton_method("new_null", function!(RbSeries::new_null, 3))?;
563
659
  class.define_singleton_method("new_object", function!(RbSeries::new_object, 3))?;
564
- class.define_singleton_method("new_list", function!(RbSeries::new_list, 3))?;
565
- class.define_singleton_method("new_opt_date", function!(RbSeries::new_opt_date, 3))?;
566
- class.define_singleton_method("new_opt_datetime", function!(RbSeries::new_opt_datetime, 3))?;
567
- class.define_method("is_sorted_flag", method!(RbSeries::is_sorted_flag, 0))?;
660
+ class.define_singleton_method("new_series_list", function!(RbSeries::new_series_list, 3))?;
661
+ class.define_singleton_method("new_decimal", function!(RbSeries::new_decimal, 3))?;
662
+ class.define_singleton_method("repeat", function!(RbSeries::repeat, 4))?;
663
+ class.define_method("struct_unnest", method!(RbSeries::struct_unnest, 0))?;
664
+ class.define_method(
665
+ "is_sorted_flag",
666
+ method!(RbSeries::is_sorted_ascending_flag, 0),
667
+ )?;
568
668
  class.define_method(
569
669
  "is_sorted_reverse_flag",
570
- method!(RbSeries::is_sorted_reverse_flag, 0),
670
+ method!(RbSeries::is_sorted_descending_flag, 0),
671
+ )?;
672
+ class.define_method(
673
+ "can_fast_explode_flag",
674
+ method!(RbSeries::can_fast_explode_flag, 0),
571
675
  )?;
572
676
  class.define_method("estimated_size", method!(RbSeries::estimated_size, 0))?;
573
677
  class.define_method("get_fmt", method!(RbSeries::get_fmt, 2))?;
@@ -581,7 +685,7 @@ fn init() -> RbResult<()> {
581
685
  class.define_method("rename", method!(RbSeries::rename, 1))?;
582
686
  class.define_method("dtype", method!(RbSeries::dtype, 0))?;
583
687
  class.define_method("inner_dtype", method!(RbSeries::inner_dtype, 0))?;
584
- class.define_method("set_sorted", method!(RbSeries::set_sorted, 1))?;
688
+ class.define_method("set_sorted", method!(RbSeries::set_sorted_flag, 1))?;
585
689
  class.define_method("mean", method!(RbSeries::mean, 0))?;
586
690
  class.define_method("max", method!(RbSeries::max, 0))?;
587
691
  class.define_method("min", method!(RbSeries::min, 0))?;
@@ -718,7 +822,6 @@ fn init() -> RbResult<()> {
718
822
  class.define_method("eq_i64", method!(RbSeries::eq_i64, 1))?;
719
823
  class.define_method("eq_f32", method!(RbSeries::eq_f32, 1))?;
720
824
  class.define_method("eq_f64", method!(RbSeries::eq_f64, 1))?;
721
- // class.define_method("eq_str", method!(RbSeries::eq_str, 1))?;
722
825
 
723
826
  // neq
724
827
  class.define_method("neq_u8", method!(RbSeries::neq_u8, 1))?;
@@ -731,7 +834,6 @@ fn init() -> RbResult<()> {
731
834
  class.define_method("neq_i64", method!(RbSeries::neq_i64, 1))?;
732
835
  class.define_method("neq_f32", method!(RbSeries::neq_f32, 1))?;
733
836
  class.define_method("neq_f64", method!(RbSeries::neq_f64, 1))?;
734
- // class.define_method("neq_str", method!(RbSeries::neq_str, 1))?;
735
837
 
736
838
  // gt
737
839
  class.define_method("gt_u8", method!(RbSeries::gt_u8, 1))?;
@@ -744,7 +846,6 @@ fn init() -> RbResult<()> {
744
846
  class.define_method("gt_i64", method!(RbSeries::gt_i64, 1))?;
745
847
  class.define_method("gt_f32", method!(RbSeries::gt_f32, 1))?;
746
848
  class.define_method("gt_f64", method!(RbSeries::gt_f64, 1))?;
747
- // class.define_method("gt_str", method!(RbSeries::gt_str, 1))?;
748
849
 
749
850
  // gt_eq
750
851
  class.define_method("gt_eq_u8", method!(RbSeries::gt_eq_u8, 1))?;
@@ -757,7 +858,6 @@ fn init() -> RbResult<()> {
757
858
  class.define_method("gt_eq_i64", method!(RbSeries::gt_eq_i64, 1))?;
758
859
  class.define_method("gt_eq_f32", method!(RbSeries::gt_eq_f32, 1))?;
759
860
  class.define_method("gt_eq_f64", method!(RbSeries::gt_eq_f64, 1))?;
760
- // class.define_method("gt_eq_str", method!(RbSeries::gt_eq_str, 1))?;
761
861
 
762
862
  // lt
763
863
  class.define_method("lt_u8", method!(RbSeries::lt_u8, 1))?;
@@ -770,7 +870,6 @@ fn init() -> RbResult<()> {
770
870
  class.define_method("lt_i64", method!(RbSeries::lt_i64, 1))?;
771
871
  class.define_method("lt_f32", method!(RbSeries::lt_f32, 1))?;
772
872
  class.define_method("lt_f64", method!(RbSeries::lt_f64, 1))?;
773
- // class.define_method("lt_str", method!(RbSeries::lt_str, 1))?;
774
873
 
775
874
  // lt_eq
776
875
  class.define_method("lt_eq_u8", method!(RbSeries::lt_eq_u8, 1))?;
@@ -783,11 +882,21 @@ fn init() -> RbResult<()> {
783
882
  class.define_method("lt_eq_i64", method!(RbSeries::lt_eq_i64, 1))?;
784
883
  class.define_method("lt_eq_f32", method!(RbSeries::lt_eq_f32, 1))?;
785
884
  class.define_method("lt_eq_f64", method!(RbSeries::lt_eq_f64, 1))?;
786
- // class.define_method("lt_eq_str", method!(RbSeries::lt_eq_str, 1))?;
885
+
886
+ // str comp
887
+ class.define_method("eq_str", method!(RbSeries::eq_str, 1))?;
888
+ class.define_method("neq_str", method!(RbSeries::neq_str, 1))?;
889
+ class.define_method("gt_str", method!(RbSeries::gt_str, 1))?;
890
+ class.define_method("gt_eq_str", method!(RbSeries::gt_eq_str, 1))?;
891
+ class.define_method("lt_str", method!(RbSeries::lt_str, 1))?;
892
+ class.define_method("lt_eq_str", method!(RbSeries::lt_eq_str, 1))?;
787
893
 
788
894
  // npy
789
895
  class.define_method("to_numo", method!(RbSeries::to_numo, 0))?;
790
896
 
897
+ // extra
898
+ class.define_method("extend_constant", method!(RbSeries::extend_constant, 2))?;
899
+
791
900
  let class = module.define_class("RbWhen", Default::default())?;
792
901
  class.define_method("_then", method!(RbWhen::then, 1))?;
793
902
 
@@ -796,196 +905,3 @@ fn init() -> RbResult<()> {
796
905
 
797
906
  Ok(())
798
907
  }
799
-
800
- fn dtype_cols(dtypes: RArray) -> RbResult<RbExpr> {
801
- let dtypes = dtypes
802
- .each()
803
- .map(|v| v?.try_convert::<Wrap<DataType>>())
804
- .collect::<RbResult<Vec<Wrap<DataType>>>>()?;
805
- let dtypes = vec_extract_wrapped(dtypes);
806
- Ok(crate::lazy::dsl::dtype_cols(dtypes))
807
- }
808
-
809
- #[allow(clippy::too_many_arguments)]
810
- fn rb_duration(
811
- days: Option<&RbExpr>,
812
- seconds: Option<&RbExpr>,
813
- nanoseconds: Option<&RbExpr>,
814
- microseconds: Option<&RbExpr>,
815
- milliseconds: Option<&RbExpr>,
816
- minutes: Option<&RbExpr>,
817
- hours: Option<&RbExpr>,
818
- weeks: Option<&RbExpr>,
819
- ) -> RbExpr {
820
- let args = DurationArgs {
821
- days: days.map(|e| e.inner.clone()),
822
- seconds: seconds.map(|e| e.inner.clone()),
823
- nanoseconds: nanoseconds.map(|e| e.inner.clone()),
824
- microseconds: microseconds.map(|e| e.inner.clone()),
825
- milliseconds: milliseconds.map(|e| e.inner.clone()),
826
- minutes: minutes.map(|e| e.inner.clone()),
827
- hours: hours.map(|e| e.inner.clone()),
828
- weeks: weeks.map(|e| e.inner.clone()),
829
- };
830
-
831
- polars::lazy::dsl::duration(args).into()
832
- }
833
-
834
- fn concat_df(seq: RArray) -> RbResult<RbDataFrame> {
835
- let mut iter = seq.each();
836
- let first = iter.next().unwrap()?;
837
-
838
- let first_rdf = get_df(first)?;
839
- let identity_df = first_rdf.slice(0, 0);
840
-
841
- let mut rdfs: Vec<PolarsResult<DataFrame>> = vec![Ok(first_rdf)];
842
-
843
- for item in iter {
844
- let rdf = get_df(item?)?;
845
- rdfs.push(Ok(rdf));
846
- }
847
-
848
- let identity = Ok(identity_df);
849
-
850
- let df = rdfs
851
- .into_iter()
852
- .fold(identity, |acc: PolarsResult<DataFrame>, df| {
853
- let mut acc = acc?;
854
- acc.vstack_mut(&df?)?;
855
- Ok(acc)
856
- })
857
- .map_err(RbPolarsErr::from)?;
858
-
859
- Ok(df.into())
860
- }
861
-
862
- fn concat_lf(lfs: Value, rechunk: bool, parallel: bool) -> RbResult<RbLazyFrame> {
863
- let (seq, len) = get_rbseq(lfs)?;
864
- let mut lfs = Vec::with_capacity(len);
865
-
866
- for res in seq.each() {
867
- let item = res?;
868
- let lf = get_lf(item)?;
869
- lfs.push(lf);
870
- }
871
-
872
- let lf = polars::lazy::dsl::concat(lfs, rechunk, parallel).map_err(RbPolarsErr::from)?;
873
- Ok(lf.into())
874
- }
875
-
876
- fn rb_diag_concat_df(seq: RArray) -> RbResult<RbDataFrame> {
877
- let mut dfs = Vec::new();
878
- for item in seq.each() {
879
- dfs.push(get_df(item?)?);
880
- }
881
- let df = diag_concat_df(&dfs).map_err(RbPolarsErr::from)?;
882
- Ok(df.into())
883
- }
884
-
885
- fn rb_hor_concat_df(seq: RArray) -> RbResult<RbDataFrame> {
886
- let mut dfs = Vec::new();
887
- for item in seq.each() {
888
- dfs.push(get_df(item?)?);
889
- }
890
- let df = hor_concat_df(&dfs).map_err(RbPolarsErr::from)?;
891
- Ok(df.into())
892
- }
893
-
894
- fn concat_series(seq: RArray) -> RbResult<RbSeries> {
895
- let mut iter = seq.each();
896
- let first = iter.next().unwrap()?;
897
-
898
- let mut s = get_series(first)?;
899
-
900
- for res in iter {
901
- let item = res?;
902
- let item = get_series(item)?;
903
- s.append(&item).map_err(RbPolarsErr::from)?;
904
- }
905
- Ok(s.into())
906
- }
907
-
908
- fn ipc_schema(rb_f: Value) -> RbResult<Value> {
909
- use polars::export::arrow::io::ipc::read::read_file_metadata;
910
- let mut r = get_file_like(rb_f, false)?;
911
- let metadata = read_file_metadata(&mut r).map_err(RbPolarsErr::arrow)?;
912
-
913
- let dict = RHash::new();
914
- for field in metadata.schema.fields {
915
- let dt: Wrap<DataType> = Wrap((&field.data_type).into());
916
- dict.aset(field.name, dt)?;
917
- }
918
- Ok(dict.into())
919
- }
920
-
921
- fn parquet_schema(rb_f: Value) -> RbResult<Value> {
922
- use polars::export::arrow::io::parquet::read::{infer_schema, read_metadata};
923
-
924
- let mut r = get_file_like(rb_f, false)?;
925
- let metadata = read_metadata(&mut r).map_err(RbPolarsErr::arrow)?;
926
- let arrow_schema = infer_schema(&metadata).map_err(RbPolarsErr::arrow)?;
927
-
928
- let dict = RHash::new();
929
- for field in arrow_schema.fields {
930
- let dt: Wrap<DataType> = Wrap((&field.data_type).into());
931
- dict.aset(field.name, dt)?;
932
- }
933
- Ok(dict.into())
934
- }
935
-
936
- fn collect_all(lfs: RArray) -> RbResult<RArray> {
937
- let lfs = lfs
938
- .each()
939
- .map(|v| v?.try_convert::<&RbLazyFrame>())
940
- .collect::<RbResult<Vec<&RbLazyFrame>>>()?;
941
-
942
- Ok(RArray::from_iter(lfs.iter().map(|lf| {
943
- let df = lf.ldf.clone().collect().unwrap();
944
- RbDataFrame::new(df)
945
- })))
946
- }
947
-
948
- fn rb_date_range(
949
- start: i64,
950
- stop: i64,
951
- every: String,
952
- closed: Wrap<ClosedWindow>,
953
- name: String,
954
- tu: Wrap<TimeUnit>,
955
- tz: Option<TimeZone>,
956
- ) -> RbResult<RbSeries> {
957
- let date_range = polars::time::date_range_impl(
958
- &name,
959
- start,
960
- stop,
961
- Duration::parse(&every),
962
- closed.0,
963
- tu.0,
964
- tz.as_ref(),
965
- )
966
- .map_err(RbPolarsErr::from)?;
967
- Ok(date_range.into_series().into())
968
- }
969
-
970
- fn coalesce_exprs(exprs: RArray) -> RbResult<RbExpr> {
971
- let exprs = rb_exprs_to_exprs(exprs)?;
972
- Ok(polars::lazy::dsl::coalesce(&exprs).into())
973
- }
974
-
975
- fn sum_exprs(exprs: RArray) -> RbResult<RbExpr> {
976
- let exprs = rb_exprs_to_exprs(exprs)?;
977
- Ok(polars::lazy::dsl::sum_exprs(exprs).into())
978
- }
979
-
980
- fn as_struct(exprs: RArray) -> RbResult<RbExpr> {
981
- let exprs = rb_exprs_to_exprs(exprs)?;
982
- Ok(polars::lazy::dsl::as_struct(&exprs).into())
983
- }
984
-
985
- fn arg_where(condition: &RbExpr) -> RbExpr {
986
- polars::lazy::dsl::arg_where(condition.inner.clone()).into()
987
- }
988
-
989
- fn get_idx_type() -> Value {
990
- Wrap(IDX_DTYPE).into_value()
991
- }