polars-df 0.15.0 → 0.26.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 (206) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +274 -0
  3. data/Cargo.lock +1465 -867
  4. data/Cargo.toml +3 -0
  5. data/LICENSE.txt +2 -2
  6. data/README.md +87 -37
  7. data/ext/polars/Cargo.toml +47 -16
  8. data/ext/polars/src/c_api/allocator.rs +7 -0
  9. data/ext/polars/src/c_api/mod.rs +1 -0
  10. data/ext/polars/src/catalog/mod.rs +1 -0
  11. data/ext/polars/src/catalog/unity.rs +470 -0
  12. data/ext/polars/src/conversion/any_value.rs +99 -84
  13. data/ext/polars/src/conversion/categorical.rs +30 -0
  14. data/ext/polars/src/conversion/chunked_array.rs +71 -62
  15. data/ext/polars/src/conversion/datetime.rs +63 -0
  16. data/ext/polars/src/conversion/mod.rs +796 -312
  17. data/ext/polars/src/dataframe/construction.rs +6 -18
  18. data/ext/polars/src/dataframe/export.rs +30 -39
  19. data/ext/polars/src/dataframe/general.rs +294 -362
  20. data/ext/polars/src/dataframe/io.rs +33 -150
  21. data/ext/polars/src/dataframe/map.rs +175 -0
  22. data/ext/polars/src/dataframe/mod.rs +37 -5
  23. data/ext/polars/src/dataframe/serde.rs +23 -8
  24. data/ext/polars/src/error.rs +44 -7
  25. data/ext/polars/src/exceptions.rs +21 -8
  26. data/ext/polars/src/expr/array.rs +86 -22
  27. data/ext/polars/src/expr/binary.rs +50 -1
  28. data/ext/polars/src/expr/bitwise.rs +39 -0
  29. data/ext/polars/src/expr/categorical.rs +20 -0
  30. data/ext/polars/src/expr/datatype.rs +51 -0
  31. data/ext/polars/src/expr/datetime.rs +99 -41
  32. data/ext/polars/src/expr/extension.rs +12 -0
  33. data/ext/polars/src/expr/general.rs +252 -128
  34. data/ext/polars/src/expr/list.rs +56 -60
  35. data/ext/polars/src/expr/meta.rs +30 -35
  36. data/ext/polars/src/expr/mod.rs +28 -6
  37. data/ext/polars/src/expr/name.rs +29 -14
  38. data/ext/polars/src/expr/rolling.rs +111 -3
  39. data/ext/polars/src/expr/selector.rs +219 -0
  40. data/ext/polars/src/expr/serde.rs +28 -0
  41. data/ext/polars/src/expr/string.rs +118 -20
  42. data/ext/polars/src/expr/struct.rs +14 -1
  43. data/ext/polars/src/file.rs +194 -86
  44. data/ext/polars/src/functions/aggregation.rs +13 -12
  45. data/ext/polars/src/functions/business.rs +2 -3
  46. data/ext/polars/src/functions/eager.rs +3 -2
  47. data/ext/polars/src/functions/io.rs +90 -18
  48. data/ext/polars/src/functions/lazy.rs +267 -118
  49. data/ext/polars/src/functions/meta.rs +8 -7
  50. data/ext/polars/src/functions/misc.rs +1 -1
  51. data/ext/polars/src/functions/mod.rs +2 -1
  52. data/ext/polars/src/functions/range.rs +88 -31
  53. data/ext/polars/src/functions/strings.rs +6 -0
  54. data/ext/polars/src/functions/utils.rs +8 -0
  55. data/ext/polars/src/interop/arrow/mod.rs +52 -1
  56. data/ext/polars/src/interop/arrow/{to_ruby.rs → to_rb.rs} +37 -7
  57. data/ext/polars/src/interop/arrow/to_rust.rs +43 -0
  58. data/ext/polars/src/interop/numo/to_numo_df.rs +1 -1
  59. data/ext/polars/src/interop/numo/to_numo_series.rs +72 -50
  60. data/ext/polars/src/io/cloud_options.rs +107 -0
  61. data/ext/polars/src/io/mod.rs +4 -0
  62. data/ext/polars/src/io/scan_options.rs +113 -0
  63. data/ext/polars/src/io/sink_options.rs +46 -0
  64. data/ext/polars/src/io/sink_output.rs +21 -0
  65. data/ext/polars/src/lazyframe/exitable.rs +39 -0
  66. data/ext/polars/src/lazyframe/general.rs +846 -368
  67. data/ext/polars/src/lazyframe/mod.rs +58 -5
  68. data/ext/polars/src/lazyframe/optflags.rs +59 -0
  69. data/ext/polars/src/lazyframe/serde.rs +36 -4
  70. data/ext/polars/src/lazyframe/sink.rs +46 -0
  71. data/ext/polars/src/lazygroupby.rs +38 -9
  72. data/ext/polars/src/lib.rs +574 -165
  73. data/ext/polars/src/map/lazy.rs +44 -74
  74. data/ext/polars/src/map/mod.rs +18 -254
  75. data/ext/polars/src/map/series.rs +241 -1087
  76. data/ext/polars/src/on_startup.rs +192 -9
  77. data/ext/polars/src/prelude.rs +1 -0
  78. data/ext/polars/src/rb_modules.rs +10 -57
  79. data/ext/polars/src/ruby/exceptions.rs +26 -0
  80. data/ext/polars/src/ruby/gvl.rs +104 -0
  81. data/ext/polars/src/ruby/lazy.rs +46 -0
  82. data/ext/polars/src/ruby/mod.rs +11 -0
  83. data/ext/polars/src/ruby/numo.rs +52 -0
  84. data/ext/polars/src/ruby/plan_callback.rs +198 -0
  85. data/ext/polars/src/ruby/rb_modules.rs +16 -0
  86. data/ext/polars/src/ruby/ruby_convert_registry.rs +51 -0
  87. data/ext/polars/src/ruby/ruby_function.rs +11 -0
  88. data/ext/polars/src/ruby/ruby_udf.rs +164 -0
  89. data/ext/polars/src/ruby/thread.rs +65 -0
  90. data/ext/polars/src/ruby/utils.rs +39 -0
  91. data/ext/polars/src/series/aggregation.rs +116 -91
  92. data/ext/polars/src/series/arithmetic.rs +16 -22
  93. data/ext/polars/src/series/comparison.rs +101 -222
  94. data/ext/polars/src/series/construction.rs +80 -70
  95. data/ext/polars/src/series/export.rs +98 -56
  96. data/ext/polars/src/series/general.rs +323 -440
  97. data/ext/polars/src/series/import.rs +22 -5
  98. data/ext/polars/src/series/map.rs +103 -0
  99. data/ext/polars/src/series/mod.rs +57 -15
  100. data/ext/polars/src/series/scatter.rs +139 -82
  101. data/ext/polars/src/sql.rs +16 -9
  102. data/ext/polars/src/testing/frame.rs +31 -0
  103. data/ext/polars/src/testing/mod.rs +5 -0
  104. data/ext/polars/src/testing/series.rs +31 -0
  105. data/ext/polars/src/timeout.rs +105 -0
  106. data/ext/polars/src/utils.rs +105 -4
  107. data/lib/polars/array_expr.rb +500 -22
  108. data/lib/polars/array_name_space.rb +384 -10
  109. data/lib/polars/batched_csv_reader.rb +48 -66
  110. data/lib/polars/binary_expr.rb +217 -0
  111. data/lib/polars/binary_name_space.rb +155 -1
  112. data/lib/polars/cat_expr.rb +224 -0
  113. data/lib/polars/cat_name_space.rb +132 -32
  114. data/lib/polars/catalog/unity/catalog_info.rb +20 -0
  115. data/lib/polars/catalog/unity/column_info.rb +31 -0
  116. data/lib/polars/catalog/unity/namespace_info.rb +21 -0
  117. data/lib/polars/catalog/unity/table_info.rb +50 -0
  118. data/lib/polars/catalog.rb +448 -0
  119. data/lib/polars/collect_batches.rb +22 -0
  120. data/lib/polars/config.rb +3 -3
  121. data/lib/polars/convert.rb +201 -36
  122. data/lib/polars/data_frame.rb +2851 -1017
  123. data/lib/polars/data_frame_plot.rb +173 -0
  124. data/lib/polars/data_type_expr.rb +52 -0
  125. data/lib/polars/data_type_group.rb +6 -0
  126. data/lib/polars/data_types.rb +118 -18
  127. data/lib/polars/date_time_expr.rb +426 -84
  128. data/lib/polars/date_time_name_space.rb +384 -111
  129. data/lib/polars/dynamic_group_by.rb +102 -10
  130. data/lib/polars/exceptions.rb +50 -5
  131. data/lib/polars/expr.rb +2159 -915
  132. data/lib/polars/extension_expr.rb +39 -0
  133. data/lib/polars/extension_name_space.rb +39 -0
  134. data/lib/polars/functions/aggregation/horizontal.rb +11 -6
  135. data/lib/polars/functions/aggregation/vertical.rb +2 -3
  136. data/lib/polars/functions/as_datatype.rb +290 -8
  137. data/lib/polars/functions/business.rb +95 -0
  138. data/lib/polars/functions/col.rb +6 -5
  139. data/lib/polars/functions/datatype.rb +62 -0
  140. data/lib/polars/functions/eager.rb +426 -24
  141. data/lib/polars/functions/escape_regex.rb +21 -0
  142. data/lib/polars/functions/lazy.rb +813 -195
  143. data/lib/polars/functions/lit.rb +21 -10
  144. data/lib/polars/functions/range/int_range.rb +74 -2
  145. data/lib/polars/functions/range/linear_space.rb +195 -0
  146. data/lib/polars/functions/range/time_range.rb +1 -1
  147. data/lib/polars/functions/repeat.rb +7 -12
  148. data/lib/polars/functions/whenthen.rb +2 -2
  149. data/lib/polars/group_by.rb +188 -58
  150. data/lib/polars/iceberg_dataset.rb +108 -0
  151. data/lib/polars/in_process_query.rb +37 -0
  152. data/lib/polars/io/cloud.rb +18 -0
  153. data/lib/polars/io/csv.rb +336 -128
  154. data/lib/polars/io/database.rb +19 -4
  155. data/lib/polars/io/delta.rb +134 -0
  156. data/lib/polars/io/iceberg.rb +34 -0
  157. data/lib/polars/io/ipc.rb +63 -63
  158. data/lib/polars/io/json.rb +16 -0
  159. data/lib/polars/io/lines.rb +172 -0
  160. data/lib/polars/io/ndjson.rb +176 -20
  161. data/lib/polars/io/parquet.rb +173 -95
  162. data/lib/polars/io/scan_options.rb +55 -0
  163. data/lib/polars/io/sink_options.rb +27 -0
  164. data/lib/polars/io/utils.rb +17 -0
  165. data/lib/polars/lazy_frame.rb +3017 -622
  166. data/lib/polars/lazy_group_by.rb +436 -2
  167. data/lib/polars/list_expr.rb +551 -59
  168. data/lib/polars/list_name_space.rb +465 -51
  169. data/lib/polars/meta_expr.rb +146 -24
  170. data/lib/polars/name_expr.rb +87 -2
  171. data/lib/polars/query_opt_flags.rb +264 -0
  172. data/lib/polars/rolling_group_by.rb +90 -5
  173. data/lib/polars/scan_cast_options.rb +86 -0
  174. data/lib/polars/schema.rb +128 -0
  175. data/lib/polars/selector.rb +245 -0
  176. data/lib/polars/selectors.rb +1048 -201
  177. data/lib/polars/series.rb +2522 -774
  178. data/lib/polars/series_plot.rb +72 -0
  179. data/lib/polars/slice.rb +1 -1
  180. data/lib/polars/sql_context.rb +13 -6
  181. data/lib/polars/string_cache.rb +19 -72
  182. data/lib/polars/string_expr.rb +561 -107
  183. data/lib/polars/string_name_space.rb +781 -109
  184. data/lib/polars/struct_expr.rb +139 -18
  185. data/lib/polars/struct_name_space.rb +19 -1
  186. data/lib/polars/testing.rb +24 -273
  187. data/lib/polars/utils/constants.rb +2 -0
  188. data/lib/polars/utils/construction/data_frame.rb +410 -0
  189. data/lib/polars/utils/construction/series.rb +350 -0
  190. data/lib/polars/utils/construction/utils.rb +9 -0
  191. data/lib/polars/utils/convert.rb +18 -8
  192. data/lib/polars/utils/deprecation.rb +11 -0
  193. data/lib/polars/utils/parse.rb +62 -9
  194. data/lib/polars/utils/reduce_balanced.rb +43 -0
  195. data/lib/polars/utils/serde.rb +22 -0
  196. data/lib/polars/utils/unstable.rb +19 -0
  197. data/lib/polars/utils/various.rb +86 -1
  198. data/lib/polars/utils.rb +63 -48
  199. data/lib/polars/version.rb +1 -1
  200. data/lib/polars.rb +85 -2
  201. metadata +80 -28
  202. data/ext/polars/src/allocator.rs +0 -13
  203. data/ext/polars/src/batched_csv.rs +0 -138
  204. data/ext/polars/src/functions/string_cache.rs +0 -25
  205. data/ext/polars/src/map/dataframe.rs +0 -338
  206. data/lib/polars/plot.rb +0 -109
@@ -1,5 +1,7 @@
1
- mod allocator;
2
- mod batched_csv;
1
+ #![allow(clippy::too_many_arguments)]
2
+
3
+ mod c_api;
4
+ mod catalog;
3
5
  mod conversion;
4
6
  mod dataframe;
5
7
  mod error;
@@ -8,6 +10,7 @@ mod expr;
8
10
  mod file;
9
11
  mod functions;
10
12
  mod interop;
13
+ mod io;
11
14
  mod lazyframe;
12
15
  mod lazygroupby;
13
16
  mod map;
@@ -15,43 +18,46 @@ mod object;
15
18
  mod on_startup;
16
19
  mod prelude;
17
20
  pub(crate) mod rb_modules;
21
+ mod ruby;
18
22
  mod series;
19
23
  mod sql;
24
+ mod testing;
25
+ mod timeout;
20
26
  mod utils;
21
27
 
22
- use batched_csv::RbBatchedCsv;
28
+ use crate::conversion::Wrap;
29
+
30
+ pub type RbDataType = Wrap<polars_core::datatypes::DataType>;
31
+
32
+ use catalog::unity::RbCatalogClient;
23
33
  use conversion::*;
24
34
  use dataframe::RbDataFrame;
25
35
  use error::RbPolarsErr;
26
- use exceptions::{RbTypeError, RbValueError};
27
- use expr::rb_exprs_to_exprs;
28
36
  use expr::RbExpr;
29
- use functions::string_cache::RbStringCacheHolder;
37
+ use expr::datatype::RbDataTypeExpr;
38
+ use expr::selector::RbSelector;
30
39
  use functions::whenthen::{RbChainedThen, RbChainedWhen, RbThen, RbWhen};
31
- use interop::arrow::to_ruby::RbArrowArrayStream;
32
- use lazyframe::RbLazyFrame;
40
+ use interop::arrow::to_rb::{RbArrowArrayStream, RbArrowSchema};
41
+ use lazyframe::{RbCollectBatches, RbInProcessQuery, RbLazyFrame, RbOptFlags};
33
42
  use lazygroupby::RbLazyGroupBy;
34
- use magnus::{define_module, function, method, prelude::*, Ruby};
43
+ use magnus::{Ruby, function, method, prelude::*};
44
+ use ruby::exceptions::{RbTypeError, RbValueError};
35
45
  use series::RbSeries;
36
46
  use sql::RbSQLContext;
37
47
 
38
- use magnus::error::Result as RbResult;
39
48
  use magnus::Error as RbErr;
49
+ use magnus::error::Result as RbResult;
40
50
 
41
51
  // TODO move
42
52
  fn re_escape(pattern: String) -> String {
43
53
  regex::escape(&pattern)
44
54
  }
45
55
 
46
- #[magnus::init]
56
+ #[magnus::init(name = "polars")]
47
57
  fn init(ruby: &Ruby) -> RbResult<()> {
48
- crate::on_startup::register_startup_deps();
58
+ unsafe { crate::on_startup::register_startup_deps(true) };
49
59
 
50
- let module = define_module("Polars")?;
51
-
52
- let class = module.define_class("RbBatchedCsv", ruby.class_object())?;
53
- class.define_singleton_method("new", function!(RbBatchedCsv::new, -1))?;
54
- class.define_method("next_batches", method!(RbBatchedCsv::next_batches, 1))?;
60
+ let module = ruby.define_module("Polars")?;
55
61
 
56
62
  let class = module.define_class("RbDataFrame", ruby.class_object())?;
57
63
  class.define_singleton_method("new", function!(RbDataFrame::init, 1))?;
@@ -65,14 +71,10 @@ fn init(ruby: &Ruby) -> RbResult<()> {
65
71
  class.define_singleton_method("from_rows", function!(RbDataFrame::from_rows, 3))?;
66
72
  class.define_singleton_method("from_hashes", function!(RbDataFrame::from_hashes, 5))?;
67
73
  class.define_singleton_method("read_json", function!(RbDataFrame::read_json, 4))?;
68
- class.define_singleton_method("read_ndjson", function!(RbDataFrame::read_ndjson, 4))?;
69
74
  class.define_method("estimated_size", method!(RbDataFrame::estimated_size, 0))?;
70
75
  class.define_method("dtype_strings", method!(RbDataFrame::dtype_strings, 0))?;
71
76
  class.define_method("write_avro", method!(RbDataFrame::write_avro, 3))?;
72
- class.define_method("write_json", method!(RbDataFrame::write_json, 3))?;
73
- class.define_method("write_ndjson", method!(RbDataFrame::write_ndjson, 1))?;
74
- class.define_method("write_csv", method!(RbDataFrame::write_csv, 10))?;
75
- class.define_method("write_ipc", method!(RbDataFrame::write_ipc, 3))?;
77
+ class.define_method("write_json", method!(RbDataFrame::write_json, 1))?;
76
78
  class.define_method(
77
79
  "write_ipc_stream",
78
80
  method!(RbDataFrame::write_ipc_stream, 3),
@@ -84,7 +86,6 @@ fn init(ruby: &Ruby) -> RbResult<()> {
84
86
  method!(RbDataFrame::__arrow_c_stream__, 0),
85
87
  )?;
86
88
  class.define_method("to_numo", method!(RbDataFrame::to_numo, 0))?;
87
- class.define_method("write_parquet", method!(RbDataFrame::write_parquet, 6))?;
88
89
  class.define_method("add", method!(RbDataFrame::add, 1))?;
89
90
  class.define_method("sub", method!(RbDataFrame::sub, 1))?;
90
91
  class.define_method("div", method!(RbDataFrame::div, 1))?;
@@ -116,17 +117,17 @@ fn init(ruby: &Ruby) -> RbResult<()> {
116
117
  class.define_method("vstack_mut", method!(RbDataFrame::vstack_mut, 1))?;
117
118
  class.define_method("vstack", method!(RbDataFrame::vstack, 1))?;
118
119
  class.define_method("drop_in_place", method!(RbDataFrame::drop_in_place, 1))?;
119
- class.define_method("select_at_idx", method!(RbDataFrame::select_at_idx, 1))?;
120
+ class.define_method("to_series", method!(RbDataFrame::to_series, 1))?;
120
121
  class.define_method(
121
122
  "get_column_index",
122
123
  method!(RbDataFrame::get_column_index, 1),
123
124
  )?;
124
125
  class.define_method("get_column", method!(RbDataFrame::get_column, 1))?;
125
126
  class.define_method("select", method!(RbDataFrame::select, 1))?;
126
- class.define_method("take", method!(RbDataFrame::gather, 1))?;
127
+ class.define_method("gather", method!(RbDataFrame::gather, 1))?;
127
128
  class.define_method(
128
- "take_with_series",
129
- method!(RbDataFrame::take_with_series, 1),
129
+ "gather_with_series",
130
+ method!(RbDataFrame::gather_with_series, 1),
130
131
  )?;
131
132
  class.define_method("replace", method!(RbDataFrame::replace, 2))?;
132
133
  class.define_method("replace_column", method!(RbDataFrame::replace_column, 2))?;
@@ -138,26 +139,31 @@ fn init(ruby: &Ruby) -> RbResult<()> {
138
139
  class.define_method("is_duplicated", method!(RbDataFrame::is_duplicated, 0))?;
139
140
  class.define_method("equals", method!(RbDataFrame::equals, 2))?;
140
141
  class.define_method("with_row_index", method!(RbDataFrame::with_row_index, 2))?;
142
+ class.define_method(
143
+ "group_by_map_groups",
144
+ method!(RbDataFrame::group_by_map_groups, 3),
145
+ )?;
141
146
  class.define_method("_clone", method!(RbDataFrame::clone, 0))?;
142
147
  class.define_method("unpivot", method!(RbDataFrame::unpivot, 4))?;
143
- class.define_method("pivot_expr", method!(RbDataFrame::pivot_expr, 7))?;
144
148
  class.define_method("partition_by", method!(RbDataFrame::partition_by, 3))?;
145
149
  class.define_method("lazy", method!(RbDataFrame::lazy, 0))?;
146
- class.define_method("mean_horizontal", method!(RbDataFrame::mean_horizontal, 1))?;
147
- class.define_method("max_horizontal", method!(RbDataFrame::max_horizontal, 0))?;
148
- class.define_method("min_horizontal", method!(RbDataFrame::min_horizontal, 0))?;
149
- class.define_method("sum_horizontal", method!(RbDataFrame::sum_horizontal, 1))?;
150
- class.define_method("to_dummies", method!(RbDataFrame::to_dummies, 3))?;
150
+ class.define_method("to_dummies", method!(RbDataFrame::to_dummies, 4))?;
151
151
  class.define_method("null_count", method!(RbDataFrame::null_count, 0))?;
152
152
  class.define_method("map_rows", method!(RbDataFrame::map_rows, 3))?;
153
153
  class.define_method("shrink_to_fit", method!(RbDataFrame::shrink_to_fit, 0))?;
154
154
  class.define_method("hash_rows", method!(RbDataFrame::hash_rows, 4))?;
155
155
  class.define_method("transpose", method!(RbDataFrame::transpose, 2))?;
156
156
  class.define_method("upsample", method!(RbDataFrame::upsample, 4))?;
157
- class.define_method("to_struct", method!(RbDataFrame::to_struct, 1))?;
158
- class.define_method("unnest", method!(RbDataFrame::unnest, 1))?;
157
+ class.define_method("to_struct", method!(RbDataFrame::to_struct, 2))?;
159
158
  class.define_method("clear", method!(RbDataFrame::clear, 0))?;
160
- class.define_method("serialize_json", method!(RbDataFrame::serialize_json, 1))?;
159
+ class.define_method(
160
+ "serialize_binary",
161
+ method!(RbDataFrame::serialize_binary, 1),
162
+ )?;
163
+ class.define_singleton_method(
164
+ "deserialize_binary",
165
+ function!(RbDataFrame::deserialize_binary, 1),
166
+ )?;
161
167
 
162
168
  let class = module.define_class("RbExpr", ruby.class_object())?;
163
169
  class.define_method("+", method!(RbExpr::add, 1))?;
@@ -176,7 +182,7 @@ fn init(ruby: &Ruby) -> RbResult<()> {
176
182
  class.define_method("gt_eq", method!(RbExpr::gt_eq, 1))?;
177
183
  class.define_method("lt_eq", method!(RbExpr::lt_eq, 1))?;
178
184
  class.define_method("lt", method!(RbExpr::lt, 1))?;
179
- class.define_method("_alias", method!(RbExpr::alias, 1))?;
185
+ class.define_method("alias", method!(RbExpr::alias, 1))?;
180
186
  class.define_method("not_", method!(RbExpr::not_, 0))?;
181
187
  class.define_method("is_null", method!(RbExpr::is_null, 0))?;
182
188
  class.define_method("is_not_null", method!(RbExpr::is_not_null, 0))?;
@@ -186,6 +192,8 @@ fn init(ruby: &Ruby) -> RbResult<()> {
186
192
  class.define_method("is_not_nan", method!(RbExpr::is_not_nan, 0))?;
187
193
  class.define_method("min", method!(RbExpr::min, 0))?;
188
194
  class.define_method("max", method!(RbExpr::max, 0))?;
195
+ class.define_method("min_by", method!(RbExpr::min_by, 1))?;
196
+ class.define_method("max_by", method!(RbExpr::max_by, 1))?;
189
197
  class.define_method("nan_max", method!(RbExpr::nan_max, 0))?;
190
198
  class.define_method("nan_min", method!(RbExpr::nan_min, 0))?;
191
199
  class.define_method("mean", method!(RbExpr::mean, 0))?;
@@ -195,9 +203,10 @@ fn init(ruby: &Ruby) -> RbResult<()> {
195
203
  class.define_method("arg_unique", method!(RbExpr::arg_unique, 0))?;
196
204
  class.define_method("unique", method!(RbExpr::unique, 0))?;
197
205
  class.define_method("unique_stable", method!(RbExpr::unique_stable, 0))?;
198
- class.define_method("first", method!(RbExpr::first, 0))?;
199
- class.define_method("last", method!(RbExpr::last, 0))?;
200
- class.define_method("implode", method!(RbExpr::implode, 0))?;
206
+ class.define_method("first", method!(RbExpr::first, 1))?;
207
+ class.define_method("last", method!(RbExpr::last, 1))?;
208
+ class.define_method("item", method!(RbExpr::item, 1))?;
209
+ class.define_method("implode", method!(RbExpr::implode, 1))?;
201
210
  class.define_method("quantile", method!(RbExpr::quantile, 2))?;
202
211
  class.define_method("cut", method!(RbExpr::cut, 4))?;
203
212
  class.define_method("qcut", method!(RbExpr::qcut, 5))?;
@@ -210,7 +219,7 @@ fn init(ruby: &Ruby) -> RbResult<()> {
210
219
  class.define_method("value_counts", method!(RbExpr::value_counts, 4))?;
211
220
  class.define_method("unique_counts", method!(RbExpr::unique_counts, 0))?;
212
221
  class.define_method("null_count", method!(RbExpr::null_count, 0))?;
213
- class.define_method("cast", method!(RbExpr::cast, 2))?;
222
+ class.define_method("cast", method!(RbExpr::cast, 3))?;
214
223
  class.define_method("sort_with", method!(RbExpr::sort_with, 2))?;
215
224
  class.define_method("arg_sort", method!(RbExpr::arg_sort, 2))?;
216
225
  class.define_method("top_k", method!(RbExpr::top_k, 1))?;
@@ -221,12 +230,11 @@ fn init(ruby: &Ruby) -> RbResult<()> {
221
230
  class.define_method("peak_max", method!(RbExpr::peak_max, 0))?;
222
231
  class.define_method("arg_max", method!(RbExpr::arg_max, 0))?;
223
232
  class.define_method("arg_min", method!(RbExpr::arg_min, 0))?;
224
- class.define_method("search_sorted", method!(RbExpr::search_sorted, 2))?;
225
- class.define_method("gather", method!(RbExpr::gather, 1))?;
226
- class.define_method("get", method!(RbExpr::get, 1))?;
233
+ class.define_method("index_of", method!(RbExpr::index_of, 1))?;
234
+ class.define_method("search_sorted", method!(RbExpr::search_sorted, 3))?;
235
+ class.define_method("gather", method!(RbExpr::gather, 2))?;
236
+ class.define_method("get", method!(RbExpr::get, 2))?;
227
237
  class.define_method("sort_by", method!(RbExpr::sort_by, 5))?;
228
- class.define_method("backward_fill", method!(RbExpr::backward_fill, 1))?;
229
- class.define_method("forward_fill", method!(RbExpr::forward_fill, 1))?;
230
238
  class.define_method("shift", method!(RbExpr::shift, 2))?;
231
239
  class.define_method("fill_null", method!(RbExpr::fill_null, 1))?;
232
240
  class.define_method(
@@ -242,17 +250,20 @@ fn init(ruby: &Ruby) -> RbResult<()> {
242
250
  class.define_method("var", method!(RbExpr::var, 1))?;
243
251
  class.define_method("is_unique", method!(RbExpr::is_unique, 0))?;
244
252
  class.define_method("is_between", method!(RbExpr::is_between, 3))?;
253
+ class.define_method("is_close", method!(RbExpr::is_close, 4))?;
245
254
  class.define_method("approx_n_unique", method!(RbExpr::approx_n_unique, 0))?;
246
255
  class.define_method("is_first_distinct", method!(RbExpr::is_first_distinct, 0))?;
247
256
  class.define_method("is_last_distinct", method!(RbExpr::is_last_distinct, 0))?;
248
- class.define_method("explode", method!(RbExpr::explode, 0))?;
257
+ class.define_method("explode", method!(RbExpr::explode, 2))?;
249
258
  class.define_method("gather_every", method!(RbExpr::gather_every, 2))?;
250
259
  class.define_method("tail", method!(RbExpr::tail, 1))?;
251
260
  class.define_method("head", method!(RbExpr::head, 1))?;
252
261
  class.define_method("slice", method!(RbExpr::slice, 2))?;
253
262
  class.define_method("append", method!(RbExpr::append, 2))?;
254
263
  class.define_method("rechunk", method!(RbExpr::rechunk, 0))?;
255
- class.define_method("round", method!(RbExpr::round, 1))?;
264
+ class.define_method("round", method!(RbExpr::round, 2))?;
265
+ class.define_method("round_sig_figs", method!(RbExpr::round_sig_figs, 1))?;
266
+ class.define_method("truncate", method!(RbExpr::truncate, 1))?;
256
267
  class.define_method("floor", method!(RbExpr::floor, 0))?;
257
268
  class.define_method("ceil", method!(RbExpr::ceil, 0))?;
258
269
  class.define_method("clip", method!(RbExpr::clip, 2))?;
@@ -260,6 +271,7 @@ fn init(ruby: &Ruby) -> RbResult<()> {
260
271
  class.define_method("sin", method!(RbExpr::sin, 0))?;
261
272
  class.define_method("cos", method!(RbExpr::cos, 0))?;
262
273
  class.define_method("tan", method!(RbExpr::tan, 0))?;
274
+ class.define_method("cot", method!(RbExpr::cot, 0))?;
263
275
  class.define_method("arcsin", method!(RbExpr::arcsin, 0))?;
264
276
  class.define_method("arccos", method!(RbExpr::arccos, 0))?;
265
277
  class.define_method("arctan", method!(RbExpr::arctan, 0))?;
@@ -269,21 +281,25 @@ fn init(ruby: &Ruby) -> RbResult<()> {
269
281
  class.define_method("arcsinh", method!(RbExpr::arcsinh, 0))?;
270
282
  class.define_method("arccosh", method!(RbExpr::arccosh, 0))?;
271
283
  class.define_method("arctanh", method!(RbExpr::arctanh, 0))?;
284
+ class.define_method("degrees", method!(RbExpr::degrees, 0))?;
285
+ class.define_method("radians", method!(RbExpr::radians, 0))?;
272
286
  class.define_method("sign", method!(RbExpr::sign, 0))?;
273
287
  class.define_method("is_duplicated", method!(RbExpr::is_duplicated, 0))?;
274
- class.define_method("over", method!(RbExpr::over, 1))?;
275
- class.define_method("_and", method!(RbExpr::_and, 1))?;
276
- class.define_method("_xor", method!(RbExpr::_xor, 1))?;
277
- class.define_method("_or", method!(RbExpr::_or, 1))?;
278
- class.define_method("is_in", method!(RbExpr::is_in, 1))?;
288
+ class.define_method("over", method!(RbExpr::over, 5))?;
289
+ class.define_method("rolling", method!(RbExpr::rolling, 4))?;
290
+ class.define_method("and_", method!(RbExpr::and_, 1))?;
291
+ class.define_method("or_", method!(RbExpr::or_, 1))?;
292
+ class.define_method("xor_", method!(RbExpr::xor_, 1))?;
293
+ class.define_method("is_in", method!(RbExpr::is_in, 2))?;
279
294
  class.define_method("repeat_by", method!(RbExpr::repeat_by, 1))?;
280
295
  class.define_method("pow", method!(RbExpr::pow, 1))?;
296
+ class.define_method("sqrt", method!(RbExpr::sqrt, 0))?;
297
+ class.define_method("cbrt", method!(RbExpr::cbrt, 0))?;
281
298
  class.define_method("cum_sum", method!(RbExpr::cum_sum, 1))?;
282
299
  class.define_method("cum_max", method!(RbExpr::cum_max, 1))?;
283
300
  class.define_method("cum_min", method!(RbExpr::cum_min, 1))?;
284
301
  class.define_method("cum_prod", method!(RbExpr::cum_prod, 1))?;
285
302
  class.define_method("product", method!(RbExpr::product, 0))?;
286
- class.define_method("shrink_dtype", method!(RbExpr::shrink_dtype, 0))?;
287
303
  class.define_method("str_to_date", method!(RbExpr::str_to_date, 4))?;
288
304
  class.define_method("str_to_datetime", method!(RbExpr::str_to_datetime, 7))?;
289
305
  class.define_method("str_to_time", method!(RbExpr::str_to_time, 3))?;
@@ -299,6 +315,8 @@ fn init(ruby: &Ruby) -> RbResult<()> {
299
315
  class.define_method("str_strip_prefix", method!(RbExpr::str_strip_prefix, 1))?;
300
316
  class.define_method("str_strip_suffix", method!(RbExpr::str_strip_suffix, 1))?;
301
317
  class.define_method("str_slice", method!(RbExpr::str_slice, 2))?;
318
+ class.define_method("str_head", method!(RbExpr::str_head, 1))?;
319
+ class.define_method("str_tail", method!(RbExpr::str_tail, 1))?;
302
320
  class.define_method("str_to_uppercase", method!(RbExpr::str_to_uppercase, 0))?;
303
321
  class.define_method("str_to_lowercase", method!(RbExpr::str_to_lowercase, 0))?;
304
322
  // class.define_method("str_to_titlecase", method!(RbExpr::str_to_titlecase, 0))?;
@@ -306,28 +324,38 @@ fn init(ruby: &Ruby) -> RbResult<()> {
306
324
  class.define_method("str_len_chars", method!(RbExpr::str_len_chars, 0))?;
307
325
  class.define_method("str_replace_n", method!(RbExpr::str_replace_n, 4))?;
308
326
  class.define_method("str_replace_all", method!(RbExpr::str_replace_all, 3))?;
327
+ class.define_method("str_normalize", method!(RbExpr::str_normalize, 1))?;
309
328
  class.define_method("str_reverse", method!(RbExpr::str_reverse, 0))?;
310
329
  class.define_method("str_zfill", method!(RbExpr::str_zfill, 1))?;
311
330
  class.define_method("str_pad_start", method!(RbExpr::str_pad_start, 2))?;
312
331
  class.define_method("str_pad_end", method!(RbExpr::str_pad_end, 2))?;
313
332
  class.define_method("str_contains", method!(RbExpr::str_contains, 3))?;
333
+ class.define_method("str_find", method!(RbExpr::str_find, 3))?;
314
334
  class.define_method("str_ends_with", method!(RbExpr::str_ends_with, 1))?;
315
335
  class.define_method("str_starts_with", method!(RbExpr::str_starts_with, 1))?;
316
- class.define_method("array_max", method!(RbExpr::array_max, 0))?;
317
- class.define_method("array_min", method!(RbExpr::array_min, 0))?;
318
- class.define_method("array_sum", method!(RbExpr::array_sum, 0))?;
319
- class.define_method("arr_unique", method!(RbExpr::arr_unique, 1))?;
336
+ class.define_method("arr_len", method!(RbExpr::arr_len, 0))?;
337
+ class.define_method("arr_max", method!(RbExpr::arr_max, 0))?;
338
+ class.define_method("arr_min", method!(RbExpr::arr_min, 0))?;
339
+ class.define_method("arr_sum", method!(RbExpr::arr_sum, 0))?;
340
+ class.define_method("arr_std", method!(RbExpr::arr_std, 1))?;
341
+ class.define_method("arr_var", method!(RbExpr::arr_var, 1))?;
342
+ class.define_method("arr_mean", method!(RbExpr::arr_mean, 0))?;
343
+ class.define_method("arr_median", method!(RbExpr::arr_median, 0))?;
320
344
  class.define_method("arr_to_list", method!(RbExpr::arr_to_list, 0))?;
321
- class.define_method("arr_all", method!(RbExpr::arr_all, 0))?;
322
- class.define_method("arr_any", method!(RbExpr::arr_any, 0))?;
323
345
  class.define_method("arr_sort", method!(RbExpr::arr_sort, 2))?;
324
- class.define_method("arr_reverse", method!(RbExpr::arr_reverse, 0))?;
325
346
  class.define_method("arr_arg_min", method!(RbExpr::arr_arg_min, 0))?;
326
347
  class.define_method("arr_arg_max", method!(RbExpr::arr_arg_max, 0))?;
327
348
  class.define_method("arr_get", method!(RbExpr::arr_get, 2))?;
328
349
  class.define_method("arr_join", method!(RbExpr::arr_join, 2))?;
329
- class.define_method("arr_contains", method!(RbExpr::arr_contains, 1))?;
350
+ class.define_method("arr_contains", method!(RbExpr::arr_contains, 2))?;
330
351
  class.define_method("arr_count_matches", method!(RbExpr::arr_count_matches, 1))?;
352
+ class.define_method("arr_to_struct", method!(RbExpr::arr_to_struct, 1))?;
353
+ class.define_method("arr_slice", method!(RbExpr::arr_slice, 3))?;
354
+ class.define_method("arr_tail", method!(RbExpr::arr_tail, 2))?;
355
+ class.define_method("arr_shift", method!(RbExpr::arr_shift, 1))?;
356
+ class.define_method("arr_explode", method!(RbExpr::arr_explode, 2))?;
357
+ class.define_method("arr_eval", method!(RbExpr::arr_eval, 2))?;
358
+ class.define_method("arr_agg", method!(RbExpr::arr_agg, 1))?;
331
359
  class.define_method("binary_contains", method!(RbExpr::bin_contains, 1))?;
332
360
  class.define_method("binary_ends_with", method!(RbExpr::bin_ends_with, 1))?;
333
361
  class.define_method("binary_starts_with", method!(RbExpr::bin_starts_with, 1))?;
@@ -335,8 +363,8 @@ fn init(ruby: &Ruby) -> RbResult<()> {
335
363
  class.define_method("str_hex_decode", method!(RbExpr::str_hex_decode, 1))?;
336
364
  class.define_method("str_base64_encode", method!(RbExpr::str_base64_encode, 0))?;
337
365
  class.define_method("str_base64_decode", method!(RbExpr::str_base64_decode, 1))?;
338
- class.define_method("str_to_integer", method!(RbExpr::str_to_integer, 2))?;
339
- class.define_method("str_json_decode", method!(RbExpr::str_json_decode, 2))?;
366
+ class.define_method("str_to_integer", method!(RbExpr::str_to_integer, 3))?;
367
+ class.define_method("str_json_decode", method!(RbExpr::str_json_decode, 1))?;
340
368
  class.define_method("binary_hex_encode", method!(RbExpr::bin_hex_encode, 0))?;
341
369
  class.define_method("binary_hex_decode", method!(RbExpr::bin_hex_decode, 1))?;
342
370
  class.define_method(
@@ -347,6 +375,12 @@ fn init(ruby: &Ruby) -> RbResult<()> {
347
375
  "binary_base64_decode",
348
376
  method!(RbExpr::bin_base64_decode, 1),
349
377
  )?;
378
+ class.define_method("bin_reinterpret", method!(RbExpr::bin_reinterpret, 2))?;
379
+ class.define_method("bin_size_bytes", method!(RbExpr::bin_size_bytes, 0))?;
380
+ class.define_method("bin_slice", method!(RbExpr::bin_slice, 2))?;
381
+ class.define_method("bin_head", method!(RbExpr::bin_head, 1))?;
382
+ class.define_method("bin_tail", method!(RbExpr::bin_tail, 1))?;
383
+ class.define_method("bin_get", method!(RbExpr::bin_get, 2))?;
350
384
  class.define_method(
351
385
  "str_json_path_match",
352
386
  method!(RbExpr::str_json_path_match, 1),
@@ -355,7 +389,6 @@ fn init(ruby: &Ruby) -> RbResult<()> {
355
389
  class.define_method("str_extract_all", method!(RbExpr::str_extract_all, 1))?;
356
390
  class.define_method("str_extract_groups", method!(RbExpr::str_extract_groups, 1))?;
357
391
  class.define_method("str_count_matches", method!(RbExpr::str_count_matches, 2))?;
358
- class.define_method("strftime", method!(RbExpr::dt_to_string, 1))?;
359
392
  class.define_method("str_split", method!(RbExpr::str_split, 1))?;
360
393
  class.define_method(
361
394
  "str_split_inclusive",
@@ -367,17 +400,34 @@ fn init(ruby: &Ruby) -> RbResult<()> {
367
400
  method!(RbExpr::str_split_exact_inclusive, 2),
368
401
  )?;
369
402
  class.define_method("str_splitn", method!(RbExpr::str_splitn, 2))?;
403
+ class.define_method("str_split_regex", method!(RbExpr::str_split_regex, 2))?;
404
+ class.define_method(
405
+ "str_split_regex_inclusive",
406
+ method!(RbExpr::str_split_regex_inclusive, 2),
407
+ )?;
370
408
  class.define_method("str_to_decimal", method!(RbExpr::str_to_decimal, 1))?;
371
409
  class.define_method("str_contains_any", method!(RbExpr::str_contains_any, 2))?;
372
- class.define_method("str_replace_many", method!(RbExpr::str_replace_many, 3))?;
410
+ class.define_method("str_replace_many", method!(RbExpr::str_replace_many, 4))?;
411
+ class.define_method("str_extract_many", method!(RbExpr::str_extract_many, 4))?;
412
+ class.define_method("str_find_many", method!(RbExpr::str_find_many, 4))?;
413
+ class.define_method("str_escape_regex", method!(RbExpr::str_escape_regex, 0))?;
373
414
  class.define_method("list_len", method!(RbExpr::list_len, 0))?;
374
- class.define_method("list_contains", method!(RbExpr::list_contains, 1))?;
415
+ class.define_method("list_contains", method!(RbExpr::list_contains, 2))?;
375
416
  class.define_method("list_count_matches", method!(RbExpr::list_count_matches, 1))?;
417
+ class.define_method(
418
+ "dt_add_business_days",
419
+ method!(RbExpr::dt_add_business_days, 4),
420
+ )?;
421
+ class.define_method("strftime", method!(RbExpr::dt_to_string, 1))?;
422
+ class.define_method("dt_millennium", method!(RbExpr::dt_millennium, 0))?;
423
+ class.define_method("dt_century", method!(RbExpr::dt_century, 0))?;
376
424
  class.define_method("dt_year", method!(RbExpr::dt_year, 0))?;
425
+ class.define_method("dt_is_business_day", method!(RbExpr::dt_is_business_day, 2))?;
377
426
  class.define_method("dt_is_leap_year", method!(RbExpr::dt_is_leap_year, 0))?;
378
427
  class.define_method("dt_iso_year", method!(RbExpr::dt_iso_year, 0))?;
379
428
  class.define_method("dt_quarter", method!(RbExpr::dt_quarter, 0))?;
380
429
  class.define_method("dt_month", method!(RbExpr::dt_month, 0))?;
430
+ class.define_method("dt_days_in_month", method!(RbExpr::dt_days_in_month, 0))?;
381
431
  class.define_method("dt_week", method!(RbExpr::dt_week, 0))?;
382
432
  class.define_method("dt_weekday", method!(RbExpr::dt_weekday, 0))?;
383
433
  class.define_method("dt_day", method!(RbExpr::dt_day, 0))?;
@@ -391,27 +441,25 @@ fn init(ruby: &Ruby) -> RbResult<()> {
391
441
  class.define_method("dt_millisecond", method!(RbExpr::dt_millisecond, 0))?;
392
442
  class.define_method("dt_microsecond", method!(RbExpr::dt_microsecond, 0))?;
393
443
  class.define_method("dt_nanosecond", method!(RbExpr::dt_nanosecond, 0))?;
394
- class.define_method("dt_total_days", method!(RbExpr::dt_total_days, 0))?;
395
- class.define_method("dt_total_hours", method!(RbExpr::dt_total_hours, 0))?;
396
- class.define_method("dt_total_minutes", method!(RbExpr::dt_total_minutes, 0))?;
397
- class.define_method("dt_total_seconds", method!(RbExpr::dt_total_seconds, 0))?;
444
+ class.define_method("dt_total_days", method!(RbExpr::dt_total_days, 1))?;
445
+ class.define_method("dt_total_hours", method!(RbExpr::dt_total_hours, 1))?;
446
+ class.define_method("dt_total_minutes", method!(RbExpr::dt_total_minutes, 1))?;
447
+ class.define_method("dt_total_seconds", method!(RbExpr::dt_total_seconds, 1))?;
398
448
  class.define_method(
399
449
  "dt_total_nanoseconds",
400
- method!(RbExpr::dt_total_nanoseconds, 0),
450
+ method!(RbExpr::dt_total_nanoseconds, 1),
401
451
  )?;
402
452
  class.define_method(
403
453
  "dt_total_microseconds",
404
- method!(RbExpr::dt_total_microseconds, 0),
454
+ method!(RbExpr::dt_total_microseconds, 1),
405
455
  )?;
406
456
  class.define_method(
407
457
  "dt_total_milliseconds",
408
- method!(RbExpr::dt_total_milliseconds, 0),
458
+ method!(RbExpr::dt_total_milliseconds, 1),
409
459
  )?;
410
460
  class.define_method("dt_timestamp", method!(RbExpr::dt_timestamp, 1))?;
411
461
  class.define_method("dt_to_string", method!(RbExpr::dt_to_string, 1))?;
412
462
  class.define_method("dt_offset_by", method!(RbExpr::dt_offset_by, 1))?;
413
- class.define_method("dt_epoch_seconds", method!(RbExpr::dt_epoch_seconds, 0))?;
414
- class.define_method("dt_with_time_unit", method!(RbExpr::dt_with_time_unit, 1))?;
415
463
  class.define_method(
416
464
  "dt_convert_time_zone",
417
465
  method!(RbExpr::dt_convert_time_zone, 1),
@@ -427,13 +475,13 @@ fn init(ruby: &Ruby) -> RbResult<()> {
427
475
  class.define_method("dt_base_utc_offset", method!(RbExpr::dt_base_utc_offset, 0))?;
428
476
  class.define_method("dt_dst_offset", method!(RbExpr::dt_dst_offset, 0))?;
429
477
  class.define_method("dt_round", method!(RbExpr::dt_round, 1))?;
478
+ class.define_method("dt_replace", method!(RbExpr::dt_replace, 8))?;
430
479
  class.define_method("dt_combine", method!(RbExpr::dt_combine, 2))?;
431
- class.define_method("map_batches", method!(RbExpr::map_batches, 5))?;
432
480
  class.define_method("dot", method!(RbExpr::dot, 1))?;
433
- class.define_method("reinterpret", method!(RbExpr::reinterpret, 1))?;
434
- class.define_method("mode", method!(RbExpr::mode, 0))?;
435
- class.define_method("exclude", method!(RbExpr::exclude, 1))?;
481
+ class.define_method("reinterpret", method!(RbExpr::reinterpret, 2))?;
482
+ class.define_method("mode", method!(RbExpr::mode, 1))?;
436
483
  class.define_method("interpolate", method!(RbExpr::interpolate, 1))?;
484
+ class.define_method("interpolate_by", method!(RbExpr::interpolate_by, 1))?;
437
485
  class.define_method("rolling_sum", method!(RbExpr::rolling_sum, 4))?;
438
486
  class.define_method("rolling_sum_by", method!(RbExpr::rolling_sum_by, 4))?;
439
487
  class.define_method("rolling_min", method!(RbExpr::rolling_min, 4))?;
@@ -453,7 +501,11 @@ fn init(ruby: &Ruby) -> RbResult<()> {
453
501
  "rolling_quantile_by",
454
502
  method!(RbExpr::rolling_quantile_by, 6),
455
503
  )?;
456
- class.define_method("rolling_skew", method!(RbExpr::rolling_skew, 2))?;
504
+ class.define_method("rolling_rank", method!(RbExpr::rolling_rank, 5))?;
505
+ class.define_method("rolling_rank_by", method!(RbExpr::rolling_rank_by, 6))?;
506
+ class.define_method("rolling_skew", method!(RbExpr::rolling_skew, 4))?;
507
+ class.define_method("rolling_kurtosis", method!(RbExpr::rolling_kurtosis, 5))?;
508
+ class.define_method("rolling_map", method!(RbExpr::rolling_map, 5))?;
457
509
  class.define_method("lower_bound", method!(RbExpr::lower_bound, 0))?;
458
510
  class.define_method("upper_bound", method!(RbExpr::upper_bound, 0))?;
459
511
  class.define_method("list_max", method!(RbExpr::list_max, 0))?;
@@ -466,24 +518,27 @@ fn init(ruby: &Ruby) -> RbResult<()> {
466
518
  method!(RbExpr::list_sample_fraction, 4),
467
519
  )?;
468
520
  class.define_method("list_gather", method!(RbExpr::list_gather, 2))?;
521
+ class.define_method("list_gather_every", method!(RbExpr::list_gather_every, 2))?;
469
522
  class.define_method("list_to_array", method!(RbExpr::list_to_array, 1))?;
470
523
  class.define_method("list_mean", method!(RbExpr::list_mean, 0))?;
524
+ class.define_method("list_median", method!(RbExpr::list_median, 0))?;
525
+ class.define_method("list_std", method!(RbExpr::list_std, 1))?;
526
+ class.define_method("list_var", method!(RbExpr::list_var, 1))?;
471
527
  class.define_method("list_tail", method!(RbExpr::list_tail, 1))?;
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))?;
528
+ class.define_method("list_sort", method!(RbExpr::list_sort, 2))?;
529
+ class.define_method("list_set_operation", method!(RbExpr::list_set_operation, 2))?;
475
530
  class.define_method("list_get", method!(RbExpr::list_get, 2))?;
476
531
  class.define_method("list_join", method!(RbExpr::list_join, 2))?;
477
532
  class.define_method("list_arg_min", method!(RbExpr::list_arg_min, 0))?;
478
533
  class.define_method("list_arg_max", method!(RbExpr::list_arg_max, 0))?;
479
- class.define_method("list_all", method!(RbExpr::list_all, 0))?;
480
- class.define_method("list_any", method!(RbExpr::list_any, 0))?;
481
534
  class.define_method("list_diff", method!(RbExpr::list_diff, 2))?;
482
535
  class.define_method("list_shift", method!(RbExpr::list_shift, 1))?;
483
536
  class.define_method("list_slice", method!(RbExpr::list_slice, 2))?;
484
- class.define_method("list_eval", method!(RbExpr::list_eval, 2))?;
485
- class.define_method("cumulative_eval", method!(RbExpr::cumulative_eval, 3))?;
486
- class.define_method("list_to_struct", method!(RbExpr::list_to_struct, 3))?;
537
+ class.define_method("list_eval", method!(RbExpr::list_eval, 1))?;
538
+ class.define_method("list_agg", method!(RbExpr::list_agg, 1))?;
539
+ class.define_method("list_filter", method!(RbExpr::list_filter, 1))?;
540
+ class.define_method("cumulative_eval", method!(RbExpr::cumulative_eval, 2))?;
541
+ class.define_method("list_to_struct", method!(RbExpr::list_to_struct, 1))?;
487
542
  class.define_method("rank", method!(RbExpr::rank, 3))?;
488
543
  class.define_method("diff", method!(RbExpr::diff, 2))?;
489
544
  class.define_method("pct_change", method!(RbExpr::pct_change, 1))?;
@@ -491,6 +546,11 @@ fn init(ruby: &Ruby) -> RbResult<()> {
491
546
  class.define_method("kurtosis", method!(RbExpr::kurtosis, 2))?;
492
547
  class.define_method("str_join", method!(RbExpr::str_join, 2))?;
493
548
  class.define_method("cat_get_categories", method!(RbExpr::cat_get_categories, 0))?;
549
+ class.define_method("cat_len_bytes", method!(RbExpr::cat_len_bytes, 0))?;
550
+ class.define_method("cat_len_chars", method!(RbExpr::cat_len_chars, 0))?;
551
+ class.define_method("cat_starts_with", method!(RbExpr::cat_starts_with, 1))?;
552
+ class.define_method("cat_ends_with", method!(RbExpr::cat_ends_with, 1))?;
553
+ class.define_method("cat_slice", method!(RbExpr::cat_slice, 2))?;
494
554
  class.define_method("reshape", method!(RbExpr::reshape, 1))?;
495
555
  class.define_method("cum_count", method!(RbExpr::cum_count, 1))?;
496
556
  class.define_method("to_physical", method!(RbExpr::to_physical, 0))?;
@@ -498,15 +558,21 @@ fn init(ruby: &Ruby) -> RbResult<()> {
498
558
  class.define_method("sample_n", method!(RbExpr::sample_n, 4))?;
499
559
  class.define_method("sample_frac", method!(RbExpr::sample_frac, 4))?;
500
560
  class.define_method("ewm_mean", method!(RbExpr::ewm_mean, 4))?;
561
+ class.define_method("ewm_mean_by", method!(RbExpr::ewm_mean_by, 2))?;
501
562
  class.define_method("ewm_std", method!(RbExpr::ewm_std, 5))?;
502
563
  class.define_method("ewm_var", method!(RbExpr::ewm_var, 5))?;
503
564
  class.define_method("extend_constant", method!(RbExpr::extend_constant, 2))?;
504
565
  class.define_method("any", method!(RbExpr::any, 1))?;
505
566
  class.define_method("all", method!(RbExpr::all, 1))?;
567
+ class.define_method("is_empty", method!(RbExpr::is_empty, 1))?;
506
568
  class.define_method(
507
569
  "struct_field_by_name",
508
570
  method!(RbExpr::struct_field_by_name, 1),
509
571
  )?;
572
+ class.define_method(
573
+ "struct_multiple_fields",
574
+ method!(RbExpr::struct_multiple_fields, 1),
575
+ )?;
510
576
  class.define_method(
511
577
  "struct_field_by_index",
512
578
  method!(RbExpr::struct_field_by_index, 1),
@@ -516,16 +582,54 @@ fn init(ruby: &Ruby) -> RbResult<()> {
516
582
  method!(RbExpr::struct_rename_fields, 1),
517
583
  )?;
518
584
  class.define_method("struct_json_encode", method!(RbExpr::struct_json_encode, 0))?;
585
+ class.define_method("struct_with_fields", method!(RbExpr::struct_with_fields, 1))?;
519
586
  class.define_method("log", method!(RbExpr::log, 1))?;
587
+ class.define_method("log1p", method!(RbExpr::log1p, 0))?;
520
588
  class.define_method("exp", method!(RbExpr::exp, 0))?;
521
589
  class.define_method("entropy", method!(RbExpr::entropy, 2))?;
522
590
  class.define_method("_hash", method!(RbExpr::hash, 4))?;
523
- class.define_method("set_sorted_flag", method!(RbExpr::set_sorted_flag, 1))?;
591
+ class.define_method("set_sorted_flag", method!(RbExpr::set_sorted_flag, 2))?;
524
592
  class.define_method("replace", method!(RbExpr::replace, 2))?;
525
593
  class.define_method("replace_strict", method!(RbExpr::replace_strict, 4))?;
594
+ class.define_method("hist", method!(RbExpr::hist, 4))?;
595
+ class.define_method("into_selector", method!(RbExpr::into_selector, 0))?;
596
+ class.define_singleton_method("new_selector", function!(RbExpr::new_selector, 1))?;
597
+ #[cfg(feature = "serialize_binary")]
598
+ class.define_method("serialize_binary", method!(RbExpr::serialize_binary, 1))?;
599
+ #[cfg(feature = "serialize_binary")]
600
+ class.define_singleton_method(
601
+ "deserialize_binary",
602
+ function!(RbExpr::deserialize_binary, 1),
603
+ )?;
604
+
605
+ // bitwise
606
+ class.define_method("bitwise_count_ones", method!(RbExpr::bitwise_count_ones, 0))?;
607
+ class.define_method(
608
+ "bitwise_count_zeros",
609
+ method!(RbExpr::bitwise_count_zeros, 0),
610
+ )?;
611
+ class.define_method(
612
+ "bitwise_leading_ones",
613
+ method!(RbExpr::bitwise_leading_ones, 0),
614
+ )?;
615
+ class.define_method(
616
+ "bitwise_leading_zeros",
617
+ method!(RbExpr::bitwise_leading_zeros, 0),
618
+ )?;
619
+ class.define_method(
620
+ "bitwise_trailing_ones",
621
+ method!(RbExpr::bitwise_trailing_ones, 0),
622
+ )?;
623
+ class.define_method(
624
+ "bitwise_trailing_zeros",
625
+ method!(RbExpr::bitwise_trailing_zeros, 0),
626
+ )?;
627
+ class.define_method("bitwise_and", method!(RbExpr::bitwise_and, 0))?;
628
+ class.define_method("bitwise_or", method!(RbExpr::bitwise_or, 0))?;
629
+ class.define_method("bitwise_xor", method!(RbExpr::bitwise_xor, 0))?;
526
630
 
527
631
  // meta
528
- class.define_method("meta_pop", method!(RbExpr::meta_pop, 0))?;
632
+ class.define_method("meta_pop", method!(RbExpr::meta_pop, 1))?;
529
633
  class.define_method("meta_eq", method!(RbExpr::meta_eq, 1))?;
530
634
  class.define_method("meta_roots", method!(RbExpr::meta_root_names, 0))?;
531
635
  class.define_method("meta_output_name", method!(RbExpr::meta_output_name, 0))?;
@@ -539,11 +643,13 @@ fn init(ruby: &Ruby) -> RbResult<()> {
539
643
  "meta_is_regex_projection",
540
644
  method!(RbExpr::meta_is_regex_projection, 0),
541
645
  )?;
542
- class.define_method("_meta_selector_add", method!(RbExpr::_meta_selector_add, 1))?;
543
- class.define_method("_meta_selector_sub", method!(RbExpr::_meta_selector_sub, 1))?;
544
- class.define_method("_meta_selector_and", method!(RbExpr::_meta_selector_and, 1))?;
545
- class.define_method("_meta_as_selector", method!(RbExpr::_meta_as_selector, 0))?;
546
- class.define_method("meta_tree_format", method!(RbExpr::meta_tree_format, 0))?;
646
+ class.define_method(
647
+ "meta_is_column_selection",
648
+ method!(RbExpr::meta_is_column_selection, 1),
649
+ )?;
650
+ class.define_method("meta_is_literal", method!(RbExpr::meta_is_literal, 1))?;
651
+ class.define_method("meta_tree_format", method!(RbExpr::meta_tree_format, 1))?;
652
+ class.define_method("meta_show_graph", method!(RbExpr::meta_show_graph, 1))?;
547
653
 
548
654
  // name
549
655
  class.define_method("name_keep", method!(RbExpr::name_keep, 0))?;
@@ -552,37 +658,45 @@ fn init(ruby: &Ruby) -> RbResult<()> {
552
658
  class.define_method("name_suffix", method!(RbExpr::name_suffix, 1))?;
553
659
  class.define_method("name_to_lowercase", method!(RbExpr::name_to_lowercase, 0))?;
554
660
  class.define_method("name_to_uppercase", method!(RbExpr::name_to_uppercase, 0))?;
661
+ class.define_method("name_replace", method!(RbExpr::name_replace, 3))?;
662
+ class.define_method("name_map_fields", method!(RbExpr::name_map_fields, 1))?;
663
+ class.define_method("name_prefix_fields", method!(RbExpr::name_prefix_fields, 1))?;
664
+ class.define_method("name_suffix_fields", method!(RbExpr::name_suffix_fields, 1))?;
665
+
666
+ // extension
667
+ class.define_method("ext_storage", method!(RbExpr::ext_storage, 0))?;
668
+ class.define_method("ext_to", method!(RbExpr::ext_to, 1))?;
555
669
 
556
670
  // maybe add to different class
557
671
  let class = module.define_module("Plr")?;
558
- class.define_singleton_method("dtype_cols", function!(functions::lazy::dtype_cols, 1))?;
559
- class.define_singleton_method("index_cols", function!(functions::lazy::index_cols, 1))?;
560
672
  class.define_singleton_method("col", function!(functions::lazy::col, 1))?;
673
+ class.define_singleton_method("element", function!(functions::lazy::element, 0))?;
561
674
  class.define_singleton_method("len", function!(functions::lazy::len, 0))?;
562
- class.define_singleton_method("first", function!(functions::lazy::first, 0))?;
563
- class.define_singleton_method("last", function!(functions::lazy::last, 0))?;
564
- class.define_singleton_method("cols", function!(functions::lazy::cols, 1))?;
565
- class.define_singleton_method("fold", function!(functions::lazy::fold, 3))?;
566
- class.define_singleton_method("cum_fold", function!(functions::lazy::cum_fold, 4))?;
567
- class.define_singleton_method("lit", function!(functions::lazy::lit, 2))?;
675
+ class.define_singleton_method("fold", function!(functions::lazy::fold, 5))?;
676
+ class.define_singleton_method("cum_fold", function!(functions::lazy::cum_fold, 6))?;
677
+ class.define_singleton_method("cum_reduce", function!(functions::lazy::cum_reduce, 4))?;
678
+ class.define_singleton_method("datetime", function!(functions::lazy::datetime, 10))?;
679
+ class.define_singleton_method("lit", function!(functions::lazy::lit, 3))?;
568
680
  class.define_singleton_method("int_range", function!(functions::range::int_range, 4))?;
569
681
  class.define_singleton_method("int_ranges", function!(functions::range::int_ranges, 4))?;
570
682
  class.define_singleton_method("repeat", function!(functions::lazy::repeat, 3))?;
571
- class.define_singleton_method("pearson_corr", function!(functions::lazy::pearson_corr, 3))?;
683
+ class.define_singleton_method("map_expr", function!(functions::lazy::map_expr, 5))?;
684
+ class.define_singleton_method("pearson_corr", function!(functions::lazy::pearson_corr, 2))?;
685
+ class.define_singleton_method("reduce", function!(functions::lazy::reduce, 4))?;
572
686
  class.define_singleton_method(
573
687
  "spearman_rank_corr",
574
- function!(functions::lazy::spearman_rank_corr, 4),
688
+ function!(functions::lazy::spearman_rank_corr, 3),
575
689
  )?;
576
690
  class.define_singleton_method("sql_expr", function!(functions::lazy::sql_expr, 1))?;
577
691
  class.define_singleton_method("cov", function!(functions::lazy::cov, 3))?;
578
692
  class.define_singleton_method("arctan2", function!(functions::lazy::arctan2, 2))?;
579
- class.define_singleton_method("arctan2d", function!(functions::lazy::arctan2d, 2))?;
580
693
  class.define_singleton_method("rolling_corr", function!(functions::lazy::rolling_corr, 5))?;
581
694
  class.define_singleton_method("rolling_cov", function!(functions::lazy::rolling_cov, 5))?;
582
695
  class.define_singleton_method("arg_sort_by", function!(functions::lazy::arg_sort_by, 5))?;
583
696
  class.define_singleton_method("when", function!(functions::whenthen::when, 1))?;
584
697
  class.define_singleton_method("concat_str", function!(functions::lazy::concat_str, 3))?;
585
698
  class.define_singleton_method("concat_list", function!(functions::lazy::concat_list, 1))?;
699
+ class.define_singleton_method("concat_arr", function!(functions::lazy::concat_arr, 1))?;
586
700
  class.define_singleton_method(
587
701
  "business_day_count",
588
702
  function!(functions::business::business_day_count, 4),
@@ -605,19 +719,24 @@ fn init(ruby: &Ruby) -> RbResult<()> {
605
719
  )?;
606
720
  class.define_singleton_method(
607
721
  "sum_horizontal",
608
- function!(functions::aggregation::sum_horizontal, 1),
722
+ function!(functions::aggregation::sum_horizontal, 2),
609
723
  )?;
610
724
  class.define_singleton_method(
611
725
  "mean_horizontal",
612
- function!(functions::aggregation::mean_horizontal, 1),
726
+ function!(functions::aggregation::mean_horizontal, 2),
613
727
  )?;
614
728
  class.define_singleton_method("as_struct", function!(functions::lazy::as_struct, 1))?;
729
+ class.define_singleton_method("field", function!(functions::lazy::field, 1))?;
615
730
  class.define_singleton_method("coalesce", function!(functions::lazy::coalesce, 1))?;
616
731
  class.define_singleton_method("arg_where", function!(functions::lazy::arg_where, 1))?;
617
732
  class.define_singleton_method(
618
733
  "concat_lf_diagonal",
619
734
  function!(functions::lazy::concat_lf_diagonal, 4),
620
735
  )?;
736
+ class.define_singleton_method(
737
+ "concat_lf_horizontal",
738
+ function!(functions::lazy::concat_lf_horizontal, 3),
739
+ )?;
621
740
  class.define_singleton_method("concat_df", function!(functions::eager::concat_df, 1))?;
622
741
  class.define_singleton_method("concat_lf", function!(functions::lazy::concat_lf, 4))?;
623
742
  class.define_singleton_method(
@@ -626,7 +745,7 @@ fn init(ruby: &Ruby) -> RbResult<()> {
626
745
  )?;
627
746
  class.define_singleton_method(
628
747
  "concat_df_horizontal",
629
- function!(functions::eager::concat_df_horizontal, 1),
748
+ function!(functions::eager::concat_df_horizontal, 2),
630
749
  )?;
631
750
  class.define_singleton_method(
632
751
  "concat_series",
@@ -634,11 +753,20 @@ fn init(ruby: &Ruby) -> RbResult<()> {
634
753
  )?;
635
754
  class.define_singleton_method("duration", function!(functions::lazy::duration, 9))?;
636
755
  class.define_singleton_method("ipc_schema", function!(functions::io::read_ipc_schema, 1))?;
756
+ class.define_singleton_method(
757
+ "read_parquet_metadata",
758
+ function!(functions::io::read_parquet_metadata, 3),
759
+ )?;
637
760
  class.define_singleton_method(
638
761
  "parquet_schema",
639
762
  function!(functions::io::read_parquet_schema, 1),
640
763
  )?;
641
- class.define_singleton_method("collect_all", function!(functions::lazy::collect_all, 1))?;
764
+ class.define_singleton_method("collect_all", function!(functions::lazy::collect_all, 3))?;
765
+ class.define_singleton_method("explain_all", function!(functions::lazy::explain_all, 2))?;
766
+ class.define_singleton_method(
767
+ "collect_all_lazy",
768
+ function!(functions::lazy::collect_all_lazy, 2),
769
+ )?;
642
770
  class.define_singleton_method("date_range", function!(functions::range::date_range, 4))?;
643
771
  class.define_singleton_method("date_ranges", function!(functions::range::date_ranges, 4))?;
644
772
  class.define_singleton_method(
@@ -651,6 +779,11 @@ fn init(ruby: &Ruby) -> RbResult<()> {
651
779
  )?;
652
780
  class.define_singleton_method("time_range", function!(functions::range::time_range, 4))?;
653
781
  class.define_singleton_method("time_ranges", function!(functions::range::time_ranges, 4))?;
782
+ class.define_singleton_method("linear_space", function!(functions::range::linear_space, 4))?;
783
+ class.define_singleton_method(
784
+ "linear_spaces",
785
+ function!(functions::range::linear_spaces, 5),
786
+ )?;
654
787
  class.define_singleton_method(
655
788
  "dtype_str_repr",
656
789
  function!(functions::misc::dtype_str_repr, 1),
@@ -660,20 +793,8 @@ fn init(ruby: &Ruby) -> RbResult<()> {
660
793
  function!(functions::meta::get_index_type, 0),
661
794
  )?;
662
795
  class.define_singleton_method(
663
- "threadpool_size",
664
- function!(functions::meta::threadpool_size, 0),
665
- )?;
666
- class.define_singleton_method(
667
- "enable_string_cache",
668
- function!(functions::string_cache::enable_string_cache, 0),
669
- )?;
670
- class.define_singleton_method(
671
- "disable_string_cache",
672
- function!(functions::string_cache::disable_string_cache, 0),
673
- )?;
674
- class.define_singleton_method(
675
- "using_string_cache",
676
- function!(functions::string_cache::using_string_cache, 0),
796
+ "thread_pool_size",
797
+ function!(functions::meta::thread_pool_size, 0),
677
798
  )?;
678
799
  class.define_singleton_method(
679
800
  "set_float_fmt",
@@ -720,39 +841,98 @@ fn init(ruby: &Ruby) -> RbResult<()> {
720
841
  function!(functions::random::set_random_seed, 1),
721
842
  )?;
722
843
  class.define_singleton_method("re_escape", function!(re_escape, 1))?;
844
+ class.define_singleton_method(
845
+ "escape_regex",
846
+ function!(functions::strings::escape_regex, 1),
847
+ )?;
848
+ class.define_singleton_method(
849
+ "assert_dataframe_equal_rb",
850
+ function!(testing::assert_dataframe_equal_rb, 9),
851
+ )?;
852
+ class.define_singleton_method(
853
+ "assert_series_equal_rb",
854
+ function!(testing::assert_series_equal_rb, 9),
855
+ )?;
856
+ class.define_singleton_method(
857
+ "get_engine_affinity",
858
+ function!(functions::utils::rb_get_engine_affinity, 0),
859
+ )?;
860
+ class.define_singleton_method(
861
+ "polars_schema_to_rbcapsule",
862
+ function!(interop::arrow::to_rb::polars_schema_to_rbcapsule, 1),
863
+ )?;
864
+ class.define_singleton_method(
865
+ "init_polars_schema_from_arrow_c_schema",
866
+ function!(interop::arrow::init_polars_schema_from_arrow_c_schema, 2),
867
+ )?;
723
868
 
724
869
  let class = module.define_class("RbLazyFrame", ruby.class_object())?;
725
- class.define_singleton_method("read_json", function!(RbLazyFrame::read_json, 1))?;
870
+ #[cfg(feature = "serialize_binary")]
871
+ class.define_method(
872
+ "serialize_binary",
873
+ method!(RbLazyFrame::serialize_binary, 1),
874
+ )?;
875
+ class.define_method("serialize_json", method!(RbLazyFrame::serialize_json, 1))?;
876
+ #[cfg(feature = "serialize_binary")]
877
+ class.define_singleton_method(
878
+ "deserialize_binary",
879
+ function!(RbLazyFrame::deserialize_binary, 1),
880
+ )?;
881
+ class.define_singleton_method(
882
+ "deserialize_json",
883
+ function!(RbLazyFrame::deserialize_json, 1),
884
+ )?;
726
885
  class.define_singleton_method(
727
886
  "new_from_ndjson",
728
- function!(RbLazyFrame::new_from_ndjson, 8),
887
+ function!(RbLazyFrame::new_from_ndjson, -1),
729
888
  )?;
730
889
  class.define_singleton_method("new_from_csv", function!(RbLazyFrame::new_from_csv, -1))?;
731
890
  class.define_singleton_method(
732
891
  "new_from_parquet",
733
- function!(RbLazyFrame::new_from_parquet, -1),
892
+ function!(RbLazyFrame::new_from_parquet, 6),
893
+ )?;
894
+ class.define_singleton_method("new_from_ipc", function!(RbLazyFrame::new_from_ipc, 3))?;
895
+ class.define_singleton_method(
896
+ "new_from_scan_lines",
897
+ function!(RbLazyFrame::new_from_scan_lines, 3),
734
898
  )?;
735
- class.define_singleton_method("new_from_ipc", function!(RbLazyFrame::new_from_ipc, 10))?;
736
- class.define_method("write_json", method!(RbLazyFrame::write_json, 1))?;
737
899
  class.define_method("describe_plan", method!(RbLazyFrame::describe_plan, 0))?;
738
900
  class.define_method(
739
901
  "describe_optimized_plan",
740
902
  method!(RbLazyFrame::describe_optimized_plan, 0),
741
903
  )?;
742
904
  class.define_method(
743
- "optimization_toggle",
744
- method!(RbLazyFrame::optimization_toggle, 9),
905
+ "describe_plan_tree",
906
+ method!(RbLazyFrame::describe_plan_tree, 0),
907
+ )?;
908
+ class.define_method(
909
+ "describe_optimized_plan_tree",
910
+ method!(RbLazyFrame::describe_optimized_plan_tree, 0),
911
+ )?;
912
+ class.define_method("to_dot", method!(RbLazyFrame::to_dot, 1))?;
913
+ class.define_method(
914
+ "to_dot_streaming_phys",
915
+ method!(RbLazyFrame::to_dot_streaming_phys, 1),
745
916
  )?;
746
917
  class.define_method("sort", method!(RbLazyFrame::sort, 5))?;
747
918
  class.define_method("sort_by_exprs", method!(RbLazyFrame::sort_by_exprs, 5))?;
919
+ class.define_method("top_k", method!(RbLazyFrame::top_k, 3))?;
920
+ class.define_method("bottom_k", method!(RbLazyFrame::bottom_k, 3))?;
748
921
  class.define_method("cache", method!(RbLazyFrame::cache, 0))?;
749
- class.define_method("collect", method!(RbLazyFrame::collect, 0))?;
750
- class.define_method("sink_parquet", method!(RbLazyFrame::sink_parquet, 7))?;
751
- class.define_method("sink_ipc", method!(RbLazyFrame::sink_ipc, 3))?;
752
- class.define_method("sink_csv", method!(RbLazyFrame::sink_csv, 15))?;
753
- class.define_method("sink_json", method!(RbLazyFrame::sink_json, 2))?;
754
- class.define_method("fetch", method!(RbLazyFrame::fetch, 1))?;
922
+ class.define_method(
923
+ "with_optimizations",
924
+ method!(RbLazyFrame::with_optimizations, 1),
925
+ )?;
926
+ class.define_method("profile", method!(RbLazyFrame::profile, 0))?;
927
+ class.define_method("collect", method!(RbLazyFrame::collect, 1))?;
928
+ class.define_method("collect_batches", method!(RbLazyFrame::collect_batches, 4))?;
929
+ class.define_method("sink_parquet", method!(RbLazyFrame::sink_parquet, 9))?;
930
+ class.define_method("sink_ipc", method!(RbLazyFrame::sink_ipc, 6))?;
931
+ class.define_method("sink_csv", method!(RbLazyFrame::sink_csv, -1))?;
932
+ class.define_method("sink_ndjson", method!(RbLazyFrame::sink_ndjson, 5))?;
933
+ class.define_method("sink_batches", method!(RbLazyFrame::sink_batches, 3))?;
755
934
  class.define_method("filter", method!(RbLazyFrame::filter, 1))?;
935
+ class.define_method("remove", method!(RbLazyFrame::remove, 1))?;
756
936
  class.define_method("select", method!(RbLazyFrame::select, 1))?;
757
937
  class.define_method("select_seq", method!(RbLazyFrame::select_seq, 1))?;
758
938
  class.define_method("group_by", method!(RbLazyFrame::group_by, 2))?;
@@ -761,15 +941,21 @@ fn init(ruby: &Ruby) -> RbResult<()> {
761
941
  "group_by_dynamic",
762
942
  method!(RbLazyFrame::group_by_dynamic, 9),
763
943
  )?;
764
- class.define_method("with_context", method!(RbLazyFrame::with_context, 1))?;
765
- class.define_method("join_asof", method!(RbLazyFrame::join_asof, 12))?;
766
- class.define_method("join", method!(RbLazyFrame::join, 10))?;
944
+ class.define_method("join_asof", method!(RbLazyFrame::join_asof, 14))?;
945
+ class.define_method("join", method!(RbLazyFrame::join, 11))?;
946
+ class.define_method("join_where", method!(RbLazyFrame::join_where, 3))?;
947
+ class.define_method("gather", method!(RbLazyFrame::gather, 2))?;
767
948
  class.define_method("with_column", method!(RbLazyFrame::with_column, 1))?;
768
949
  class.define_method("with_columns", method!(RbLazyFrame::with_columns, 1))?;
769
950
  class.define_method(
770
951
  "with_columns_seq",
771
952
  method!(RbLazyFrame::with_columns_seq, 1),
772
953
  )?;
954
+ class.define_method("match_to_schema", method!(RbLazyFrame::match_to_schema, 7))?;
955
+ class.define_method(
956
+ "pipe_with_schema",
957
+ method!(RbLazyFrame::pipe_with_schema, 1),
958
+ )?;
773
959
  class.define_method("rename", method!(RbLazyFrame::rename, 3))?;
774
960
  class.define_method("reverse", method!(RbLazyFrame::reverse, 0))?;
775
961
  class.define_method("shift", method!(RbLazyFrame::shift, 2))?;
@@ -782,27 +968,52 @@ fn init(ruby: &Ruby) -> RbResult<()> {
782
968
  class.define_method("var", method!(RbLazyFrame::var, 1))?;
783
969
  class.define_method("median", method!(RbLazyFrame::median, 0))?;
784
970
  class.define_method("quantile", method!(RbLazyFrame::quantile, 2))?;
785
- class.define_method("explode", method!(RbLazyFrame::explode, 1))?;
971
+ class.define_method("explode", method!(RbLazyFrame::explode, 3))?;
786
972
  class.define_method("null_count", method!(RbLazyFrame::null_count, 0))?;
787
973
  class.define_method("unique", method!(RbLazyFrame::unique, 3))?;
974
+ class.define_method("drop_nans", method!(RbLazyFrame::drop_nans, 1))?;
788
975
  class.define_method("drop_nulls", method!(RbLazyFrame::drop_nulls, 1))?;
789
976
  class.define_method("slice", method!(RbLazyFrame::slice, 2))?;
790
977
  class.define_method("tail", method!(RbLazyFrame::tail, 1))?;
978
+ class.define_method("pivot", method!(RbLazyFrame::pivot, 8))?;
791
979
  class.define_method("unpivot", method!(RbLazyFrame::unpivot, 4))?;
792
980
  class.define_method("with_row_index", method!(RbLazyFrame::with_row_index, 2))?;
981
+ class.define_method("map_batches", method!(RbLazyFrame::map_batches, 7))?;
793
982
  class.define_method("drop", method!(RbLazyFrame::drop, 1))?;
794
983
  class.define_method("cast", method!(RbLazyFrame::cast, 2))?;
795
984
  class.define_method("cast_all", method!(RbLazyFrame::cast_all, 2))?;
796
985
  class.define_method("_clone", method!(RbLazyFrame::clone, 0))?;
797
986
  class.define_method("collect_schema", method!(RbLazyFrame::collect_schema, 0))?;
798
- class.define_method("unnest", method!(RbLazyFrame::unnest, 1))?;
987
+ class.define_method("unnest", method!(RbLazyFrame::unnest, 2))?;
799
988
  class.define_method("count", method!(RbLazyFrame::count, 0))?;
800
- class.define_method("merge_sorted", method!(RbLazyFrame::merge_sorted, 2))?;
989
+ class.define_method("merge_sorted", method!(RbLazyFrame::merge_sorted, 3))?;
990
+ class.define_method("hint_sorted", method!(RbLazyFrame::hint_sorted, 3))?;
991
+ class.define_method(
992
+ "collect_concurrently",
993
+ method!(RbLazyFrame::collect_concurrently, 0),
994
+ )?;
995
+
996
+ let class = module.define_class("RbCollectBatches", ruby.class_object())?;
997
+ class.define_method("next", method!(RbCollectBatches::next, 0))?;
998
+ class.define_method(
999
+ "arrow_c_stream",
1000
+ method!(RbCollectBatches::__arrow_c_stream__, 0),
1001
+ )?;
1002
+
1003
+ let class = module.define_class("RbInProcessQuery", ruby.class_object())?;
1004
+ class.define_method("cancel", method!(RbInProcessQuery::cancel, 0))?;
1005
+ class.define_method("fetch", method!(RbInProcessQuery::fetch, 0))?;
1006
+ class.define_method(
1007
+ "fetch_blocking",
1008
+ method!(RbInProcessQuery::fetch_blocking, 0),
1009
+ )?;
801
1010
 
802
1011
  let class = module.define_class("RbLazyGroupBy", ruby.class_object())?;
1012
+ class.define_method("having", method!(RbLazyGroupBy::having, 1))?;
803
1013
  class.define_method("agg", method!(RbLazyGroupBy::agg, 1))?;
804
1014
  class.define_method("head", method!(RbLazyGroupBy::head, 1))?;
805
1015
  class.define_method("tail", method!(RbLazyGroupBy::tail, 1))?;
1016
+ class.define_method("map_groups", method!(RbLazyGroupBy::map_groups, 2))?;
806
1017
 
807
1018
  let class = module.define_class("RbSeries", ruby.class_object())?;
808
1019
  class.define_singleton_method("new_opt_bool", function!(RbSeries::new_opt_bool, 3))?;
@@ -810,12 +1021,15 @@ fn init(ruby: &Ruby) -> RbResult<()> {
810
1021
  class.define_singleton_method("new_opt_u16", function!(RbSeries::new_opt_u16, 3))?;
811
1022
  class.define_singleton_method("new_opt_u32", function!(RbSeries::new_opt_u32, 3))?;
812
1023
  class.define_singleton_method("new_opt_u64", function!(RbSeries::new_opt_u64, 3))?;
1024
+ class.define_singleton_method("new_opt_u128", function!(RbSeries::new_opt_u128, 3))?;
813
1025
  class.define_singleton_method("new_opt_i8", function!(RbSeries::new_opt_i8, 3))?;
814
1026
  class.define_singleton_method("new_opt_i16", function!(RbSeries::new_opt_i16, 3))?;
815
1027
  class.define_singleton_method("new_opt_i32", function!(RbSeries::new_opt_i32, 3))?;
816
1028
  class.define_singleton_method("new_opt_i64", function!(RbSeries::new_opt_i64, 3))?;
1029
+ class.define_singleton_method("new_opt_i128", function!(RbSeries::new_opt_i128, 3))?;
817
1030
  class.define_singleton_method("new_opt_f32", function!(RbSeries::new_opt_f32, 3))?;
818
1031
  class.define_singleton_method("new_opt_f64", function!(RbSeries::new_opt_f64, 3))?;
1032
+ class.define_singleton_method("new_opt_f16", function!(RbSeries::new_opt_f16, 3))?;
819
1033
  class.define_singleton_method(
820
1034
  "new_from_any_values",
821
1035
  function!(RbSeries::new_from_any_values, 3),
@@ -829,9 +1043,8 @@ fn init(ruby: &Ruby) -> RbResult<()> {
829
1043
  class.define_singleton_method("new_null", function!(RbSeries::new_null, 3))?;
830
1044
  class.define_singleton_method("new_object", function!(RbSeries::new_object, 3))?;
831
1045
  class.define_singleton_method("new_series_list", function!(RbSeries::new_series_list, 3))?;
832
- class.define_singleton_method("new_array", function!(RbSeries::new_array, 5))?;
1046
+ class.define_singleton_method("new_array", function!(RbSeries::new_array, 4))?;
833
1047
  class.define_singleton_method("new_decimal", function!(RbSeries::new_decimal, 3))?;
834
- class.define_singleton_method("repeat", function!(RbSeries::repeat, 4))?;
835
1048
  class.define_singleton_method(
836
1049
  "from_arrow_c_stream",
837
1050
  function!(RbSeries::from_arrow_c_stream, 1),
@@ -857,9 +1070,11 @@ fn init(ruby: &Ruby) -> RbResult<()> {
857
1070
  class.define_method("cat_is_local", method!(RbSeries::cat_is_local, 0))?;
858
1071
  class.define_method("cat_to_local", method!(RbSeries::cat_to_local, 0))?;
859
1072
  class.define_method("estimated_size", method!(RbSeries::estimated_size, 0))?;
1073
+ class.define_method("reshape", method!(RbSeries::reshape, 1))?;
860
1074
  class.define_method("get_fmt", method!(RbSeries::get_fmt, 2))?;
861
1075
  class.define_method("rechunk", method!(RbSeries::rechunk, 1))?;
862
- class.define_method("get_idx", method!(RbSeries::get_idx, 1))?;
1076
+ class.define_method("get_index", method!(RbSeries::get_index, 1))?;
1077
+ class.define_method("get_index_signed", method!(RbSeries::get_index_signed, 1))?;
863
1078
  class.define_method("bitand", method!(RbSeries::bitand, 1))?;
864
1079
  class.define_method("bitor", method!(RbSeries::bitor, 1))?;
865
1080
  class.define_method("bitxor", method!(RbSeries::bitxor, 1))?;
@@ -867,12 +1082,17 @@ fn init(ruby: &Ruby) -> RbResult<()> {
867
1082
  class.define_method("name", method!(RbSeries::name, 0))?;
868
1083
  class.define_method("rename", method!(RbSeries::rename, 1))?;
869
1084
  class.define_method("dtype", method!(RbSeries::dtype, 0))?;
870
- class.define_method("inner_dtype", method!(RbSeries::inner_dtype, 0))?;
871
1085
  class.define_method("set_sorted", method!(RbSeries::set_sorted_flag, 1))?;
872
1086
  class.define_method("mean", method!(RbSeries::mean, 0))?;
873
1087
  class.define_method("max", method!(RbSeries::max, 0))?;
874
1088
  class.define_method("min", method!(RbSeries::min, 0))?;
875
1089
  class.define_method("sum", method!(RbSeries::sum, 0))?;
1090
+ class.define_method("first", method!(RbSeries::first, 1))?;
1091
+ class.define_method("last", method!(RbSeries::last, 1))?;
1092
+ class.define_method("approx_n_unique", method!(RbSeries::approx_n_unique, 0))?;
1093
+ class.define_method("bitwise_and", method!(RbSeries::bitwise_and, 0))?;
1094
+ class.define_method("bitwise_or", method!(RbSeries::bitwise_or, 0))?;
1095
+ class.define_method("bitwise_xor", method!(RbSeries::bitwise_xor, 0))?;
876
1096
  class.define_method("n_chunks", method!(RbSeries::n_chunks, 0))?;
877
1097
  class.define_method("append", method!(RbSeries::append, 1))?;
878
1098
  class.define_method("extend", method!(RbSeries::extend, 1))?;
@@ -888,13 +1108,15 @@ fn init(ruby: &Ruby) -> RbResult<()> {
888
1108
  class.define_method("slice", method!(RbSeries::slice, 2))?;
889
1109
  class.define_method("any", method!(RbSeries::any, 1))?;
890
1110
  class.define_method("all", method!(RbSeries::all, 1))?;
1111
+ class.define_method("is_empty", method!(RbSeries::is_empty, 1))?;
891
1112
  class.define_method("arg_min", method!(RbSeries::arg_min, 0))?;
892
1113
  class.define_method("arg_max", method!(RbSeries::arg_max, 0))?;
893
- class.define_method("take_with_series", method!(RbSeries::take_with_series, 1))?;
1114
+ class.define_method(
1115
+ "gather_with_series",
1116
+ method!(RbSeries::gather_with_series, 1),
1117
+ )?;
894
1118
  class.define_method("null_count", method!(RbSeries::null_count, 0))?;
895
1119
  class.define_method("has_nulls", method!(RbSeries::has_nulls, 0))?;
896
- class.define_method("sample_n", method!(RbSeries::sample_n, 4))?;
897
- class.define_method("sample_frac", method!(RbSeries::sample_frac, 4))?;
898
1120
  class.define_method("equals", method!(RbSeries::equals, 4))?;
899
1121
  class.define_method("eq", method!(RbSeries::eq, 1))?;
900
1122
  class.define_method("neq", method!(RbSeries::neq, 1))?;
@@ -902,24 +1124,35 @@ fn init(ruby: &Ruby) -> RbResult<()> {
902
1124
  class.define_method("gt_eq", method!(RbSeries::gt_eq, 1))?;
903
1125
  class.define_method("lt", method!(RbSeries::lt, 1))?;
904
1126
  class.define_method("lt_eq", method!(RbSeries::lt_eq, 1))?;
905
- class.define_method("not", method!(RbSeries::not, 0))?;
906
- class.define_method("to_s", method!(RbSeries::to_s, 0))?;
1127
+ class.define_method("not_", method!(RbSeries::not_, 0))?;
1128
+ class.define_method("shrink_dtype", method!(RbSeries::shrink_dtype, 0))?;
1129
+ class.define_method(
1130
+ "str_to_decimal_infer",
1131
+ method!(RbSeries::str_to_decimal_infer, 1),
1132
+ )?;
1133
+ class.define_method("list_to_struct", method!(RbSeries::list_to_struct, 2))?;
1134
+ class.define_method("str_json_decode", method!(RbSeries::str_json_decode, 1))?;
1135
+ class.define_method("to_s", method!(RbSeries::as_str, 0))?;
907
1136
  class.define_method("len", method!(RbSeries::len, 0))?;
908
1137
  class.define_method("to_a", method!(RbSeries::to_a, 0))?;
909
1138
  class.define_method("median", method!(RbSeries::median, 0))?;
910
1139
  class.define_method("quantile", method!(RbSeries::quantile, 2))?;
911
1140
  class.define_method("_clone", method!(RbSeries::clone, 0))?;
912
- class.define_method("apply_lambda", method!(RbSeries::apply_lambda, 3))?;
1141
+ class.define_method("map_elements", method!(RbSeries::map_elements, 3))?;
913
1142
  class.define_method("zip_with", method!(RbSeries::zip_with, 2))?;
914
- class.define_method("to_dummies", method!(RbSeries::to_dummies, 2))?;
1143
+ class.define_method("to_dummies", method!(RbSeries::to_dummies, 3))?;
915
1144
  class.define_method("n_unique", method!(RbSeries::n_unique, 0))?;
916
1145
  class.define_method("floor", method!(RbSeries::floor, 0))?;
917
1146
  class.define_method("shrink_to_fit", method!(RbSeries::shrink_to_fit, 0))?;
918
1147
  class.define_method("dot", method!(RbSeries::dot, 1))?;
919
1148
  class.define_method("skew", method!(RbSeries::skew, 1))?;
920
1149
  class.define_method("kurtosis", method!(RbSeries::kurtosis, 2))?;
921
- class.define_method("cast", method!(RbSeries::cast, 2))?;
922
- class.define_method("time_unit", method!(RbSeries::time_unit, 0))?;
1150
+ class.define_method("cast", method!(RbSeries::cast, 3))?;
1151
+ class.define_method("get_chunks", method!(RbSeries::get_chunks, 0))?;
1152
+ class.define_method("is_sorted", method!(RbSeries::is_sorted, 2))?;
1153
+ class.define_method("clear", method!(RbSeries::clear, 0))?;
1154
+ class.define_method("head", method!(RbSeries::head, 1))?;
1155
+ class.define_method("tail", method!(RbSeries::tail, 1))?;
923
1156
  class.define_method("scatter", method!(RbSeries::scatter, 2))?;
924
1157
 
925
1158
  // set
@@ -1004,6 +1237,7 @@ fn init(ruby: &Ruby) -> RbResult<()> {
1004
1237
  class.define_method("eq_i16", method!(RbSeries::eq_i16, 1))?;
1005
1238
  class.define_method("eq_i32", method!(RbSeries::eq_i32, 1))?;
1006
1239
  class.define_method("eq_i64", method!(RbSeries::eq_i64, 1))?;
1240
+ class.define_method("eq_i128", method!(RbSeries::eq_i128, 1))?;
1007
1241
  class.define_method("eq_f32", method!(RbSeries::eq_f32, 1))?;
1008
1242
  class.define_method("eq_f64", method!(RbSeries::eq_f64, 1))?;
1009
1243
 
@@ -1016,6 +1250,7 @@ fn init(ruby: &Ruby) -> RbResult<()> {
1016
1250
  class.define_method("neq_i16", method!(RbSeries::neq_i16, 1))?;
1017
1251
  class.define_method("neq_i32", method!(RbSeries::neq_i32, 1))?;
1018
1252
  class.define_method("neq_i64", method!(RbSeries::neq_i64, 1))?;
1253
+ class.define_method("neq_i128", method!(RbSeries::neq_i128, 1))?;
1019
1254
  class.define_method("neq_f32", method!(RbSeries::neq_f32, 1))?;
1020
1255
  class.define_method("neq_f64", method!(RbSeries::neq_f64, 1))?;
1021
1256
 
@@ -1028,6 +1263,7 @@ fn init(ruby: &Ruby) -> RbResult<()> {
1028
1263
  class.define_method("gt_i16", method!(RbSeries::gt_i16, 1))?;
1029
1264
  class.define_method("gt_i32", method!(RbSeries::gt_i32, 1))?;
1030
1265
  class.define_method("gt_i64", method!(RbSeries::gt_i64, 1))?;
1266
+ class.define_method("gt_i128", method!(RbSeries::gt_i128, 1))?;
1031
1267
  class.define_method("gt_f32", method!(RbSeries::gt_f32, 1))?;
1032
1268
  class.define_method("gt_f64", method!(RbSeries::gt_f64, 1))?;
1033
1269
 
@@ -1040,6 +1276,7 @@ fn init(ruby: &Ruby) -> RbResult<()> {
1040
1276
  class.define_method("gt_eq_i16", method!(RbSeries::gt_eq_i16, 1))?;
1041
1277
  class.define_method("gt_eq_i32", method!(RbSeries::gt_eq_i32, 1))?;
1042
1278
  class.define_method("gt_eq_i64", method!(RbSeries::gt_eq_i64, 1))?;
1279
+ class.define_method("gt_eq_i128", method!(RbSeries::gt_eq_i128, 1))?;
1043
1280
  class.define_method("gt_eq_f32", method!(RbSeries::gt_eq_f32, 1))?;
1044
1281
  class.define_method("gt_eq_f64", method!(RbSeries::gt_eq_f64, 1))?;
1045
1282
 
@@ -1052,6 +1289,7 @@ fn init(ruby: &Ruby) -> RbResult<()> {
1052
1289
  class.define_method("lt_i16", method!(RbSeries::lt_i16, 1))?;
1053
1290
  class.define_method("lt_i32", method!(RbSeries::lt_i32, 1))?;
1054
1291
  class.define_method("lt_i64", method!(RbSeries::lt_i64, 1))?;
1292
+ class.define_method("lt_i128", method!(RbSeries::lt_i128, 1))?;
1055
1293
  class.define_method("lt_f32", method!(RbSeries::lt_f32, 1))?;
1056
1294
  class.define_method("lt_f64", method!(RbSeries::lt_f64, 1))?;
1057
1295
 
@@ -1064,6 +1302,7 @@ fn init(ruby: &Ruby) -> RbResult<()> {
1064
1302
  class.define_method("lt_eq_i16", method!(RbSeries::lt_eq_i16, 1))?;
1065
1303
  class.define_method("lt_eq_i32", method!(RbSeries::lt_eq_i32, 1))?;
1066
1304
  class.define_method("lt_eq_i64", method!(RbSeries::lt_eq_i64, 1))?;
1305
+ class.define_method("lt_eq_i128", method!(RbSeries::lt_eq_i128, 1))?;
1067
1306
  class.define_method("lt_eq_f32", method!(RbSeries::lt_eq_f32, 1))?;
1068
1307
  class.define_method("lt_eq_f64", method!(RbSeries::lt_eq_f64, 1))?;
1069
1308
 
@@ -1078,9 +1317,6 @@ fn init(ruby: &Ruby) -> RbResult<()> {
1078
1317
  // npy
1079
1318
  class.define_method("to_numo", method!(RbSeries::to_numo, 0))?;
1080
1319
 
1081
- // extra
1082
- class.define_method("extend_constant", method!(RbSeries::extend_constant, 2))?;
1083
-
1084
1320
  // when then
1085
1321
  let class = module.define_class("RbWhen", ruby.class_object())?;
1086
1322
  class.define_method("then", method!(RbWhen::then, 1))?;
@@ -1104,13 +1340,186 @@ fn init(ruby: &Ruby) -> RbResult<()> {
1104
1340
  class.define_method("register", method!(RbSQLContext::register, 2))?;
1105
1341
  class.define_method("unregister", method!(RbSQLContext::unregister, 1))?;
1106
1342
 
1107
- // string cache
1108
- let class = module.define_class("RbStringCacheHolder", ruby.class_object())?;
1109
- class.define_singleton_method("hold", function!(RbStringCacheHolder::hold, 0))?;
1110
-
1111
1343
  // arrow array stream
1112
- let class = module.define_class("RbArrowArrayStream", ruby.class_object())?;
1344
+ let class = module.define_class("ArrowArrayStream", ruby.class_object())?;
1113
1345
  class.define_method("to_i", method!(RbArrowArrayStream::to_i, 0))?;
1114
1346
 
1347
+ // arrow schema
1348
+ let class = module.define_class("ArrowSchema", ruby.class_object())?;
1349
+ class.define_method("to_i", method!(RbArrowSchema::to_i, 0))?;
1350
+
1351
+ // catalog
1352
+ let class = module.define_class("RbCatalogClient", ruby.class_object())?;
1353
+ class.define_singleton_method("new", function!(RbCatalogClient::new, 2))?;
1354
+ class.define_singleton_method(
1355
+ "type_json_to_polars_type",
1356
+ function!(RbCatalogClient::type_json_to_polars_type, 1),
1357
+ )?;
1358
+ class.define_method("list_catalogs", method!(RbCatalogClient::list_catalogs, 0))?;
1359
+ class.define_method(
1360
+ "list_namespaces",
1361
+ method!(RbCatalogClient::list_namespaces, 1),
1362
+ )?;
1363
+ class.define_method("list_tables", method!(RbCatalogClient::list_tables, 2))?;
1364
+ class.define_method(
1365
+ "get_table_info",
1366
+ method!(RbCatalogClient::get_table_info, 3),
1367
+ )?;
1368
+ class.define_method(
1369
+ "create_catalog",
1370
+ method!(RbCatalogClient::create_catalog, 3),
1371
+ )?;
1372
+ class.define_method(
1373
+ "delete_catalog",
1374
+ method!(RbCatalogClient::delete_catalog, 2),
1375
+ )?;
1376
+ class.define_method(
1377
+ "create_namespace",
1378
+ method!(RbCatalogClient::create_namespace, 4),
1379
+ )?;
1380
+ class.define_method(
1381
+ "delete_namespace",
1382
+ method!(RbCatalogClient::delete_namespace, 3),
1383
+ )?;
1384
+ class.define_method("create_table", method!(RbCatalogClient::create_table, 9))?;
1385
+ class.define_method("delete_table", method!(RbCatalogClient::delete_table, 3))?;
1386
+
1387
+ // categories
1388
+ let class = module.define_class("RbCategories", ruby.class_object())?;
1389
+ class.define_singleton_method(
1390
+ "global_categories",
1391
+ function!(RbCategories::global_categories, 0),
1392
+ )?;
1393
+
1394
+ // data type expr
1395
+ let class = module.define_class("RbDataTypeExpr", ruby.class_object())?;
1396
+ class.define_singleton_method("from_dtype", function!(RbDataTypeExpr::from_dtype, 1))?;
1397
+ class.define_singleton_method("of_expr", function!(RbDataTypeExpr::of_expr, 1))?;
1398
+ class.define_singleton_method("self_dtype", function!(RbDataTypeExpr::self_dtype, 0))?;
1399
+ class.define_method("collect_dtype", method!(RbDataTypeExpr::collect_dtype, 1))?;
1400
+ class.define_singleton_method(
1401
+ "struct_with_fields",
1402
+ function!(RbDataTypeExpr::struct_with_fields, 1),
1403
+ )?;
1404
+
1405
+ // selector
1406
+ let class = module.define_class("RbSelector", ruby.class_object())?;
1407
+ class.define_method("union", method!(RbSelector::union, 1))?;
1408
+ class.define_method("difference", method!(RbSelector::difference, 1))?;
1409
+ class.define_method("exclusive_or", method!(RbSelector::exclusive_or, 1))?;
1410
+ class.define_method("intersect", method!(RbSelector::intersect, 1))?;
1411
+ class.define_singleton_method("by_dtype", function!(RbSelector::by_dtype, 1))?;
1412
+ class.define_singleton_method("by_name", function!(RbSelector::by_name, 3))?;
1413
+ class.define_singleton_method("by_index", function!(RbSelector::by_index, 2))?;
1414
+ class.define_singleton_method("first", function!(RbSelector::first, 1))?;
1415
+ class.define_singleton_method("last", function!(RbSelector::last, 1))?;
1416
+ class.define_singleton_method("matches", function!(RbSelector::matches, 1))?;
1417
+ class.define_singleton_method("enum_", function!(RbSelector::enum_, 0))?;
1418
+ class.define_singleton_method("categorical", function!(RbSelector::categorical, 0))?;
1419
+ class.define_singleton_method("nested", function!(RbSelector::nested, 0))?;
1420
+ class.define_singleton_method("list", function!(RbSelector::list, 1))?;
1421
+ class.define_singleton_method("array", function!(RbSelector::array, 2))?;
1422
+ class.define_singleton_method("struct_", function!(RbSelector::struct_, 0))?;
1423
+ class.define_singleton_method("integer", function!(RbSelector::integer, 0))?;
1424
+ class.define_singleton_method("signed_integer", function!(RbSelector::signed_integer, 0))?;
1425
+ class.define_singleton_method(
1426
+ "unsigned_integer",
1427
+ function!(RbSelector::unsigned_integer, 0),
1428
+ )?;
1429
+ class.define_singleton_method("float", function!(RbSelector::float, 0))?;
1430
+ class.define_singleton_method("decimal", function!(RbSelector::decimal, 0))?;
1431
+ class.define_singleton_method("numeric", function!(RbSelector::numeric, 0))?;
1432
+ class.define_singleton_method("temporal", function!(RbSelector::temporal, 0))?;
1433
+ class.define_singleton_method("datetime", function!(RbSelector::datetime, 2))?;
1434
+ class.define_singleton_method("duration", function!(RbSelector::duration, 1))?;
1435
+ class.define_singleton_method("object", function!(RbSelector::object, 0))?;
1436
+ class.define_singleton_method("empty", function!(RbSelector::empty, 0))?;
1437
+ class.define_singleton_method("all", function!(RbSelector::all, 0))?;
1438
+ class.define_method("_hash", method!(RbSelector::hash, 0))?;
1439
+
1440
+ // opt flags
1441
+ let class = module.define_class("RbOptFlags", ruby.class_object())?;
1442
+ class.define_singleton_method("empty", function!(RbOptFlags::empty, 0))?;
1443
+ class.define_singleton_method("default", function!(RbOptFlags::default, 0))?;
1444
+ class.define_method("no_optimizations", method!(RbOptFlags::no_optimizations, 0))?;
1445
+ class.define_method("copy", method!(RbOptFlags::copy, 0))?;
1446
+ class.define_method("type_coercion", method!(RbOptFlags::get_type_coercion, 0))?;
1447
+ class.define_method("type_coercion=", method!(RbOptFlags::set_type_coercion, 1))?;
1448
+ class.define_method("type_check", method!(RbOptFlags::get_type_check, 0))?;
1449
+ class.define_method("type_check=", method!(RbOptFlags::set_type_check, 1))?;
1450
+ class.define_method(
1451
+ "projection_pushdown",
1452
+ method!(RbOptFlags::get_projection_pushdown, 0),
1453
+ )?;
1454
+ class.define_method(
1455
+ "projection_pushdown=",
1456
+ method!(RbOptFlags::set_projection_pushdown, 1),
1457
+ )?;
1458
+ class.define_method(
1459
+ "predicate_pushdown",
1460
+ method!(RbOptFlags::get_predicate_pushdown, 0),
1461
+ )?;
1462
+ class.define_method(
1463
+ "predicate_pushdown=",
1464
+ method!(RbOptFlags::set_predicate_pushdown, 1),
1465
+ )?;
1466
+ class.define_method(
1467
+ "cluster_with_columns",
1468
+ method!(RbOptFlags::get_cluster_with_columns, 0),
1469
+ )?;
1470
+ class.define_method(
1471
+ "cluster_with_columns=",
1472
+ method!(RbOptFlags::set_cluster_with_columns, 1),
1473
+ )?;
1474
+ class.define_method(
1475
+ "simplify_expression",
1476
+ method!(RbOptFlags::get_simplify_expression, 0),
1477
+ )?;
1478
+ class.define_method(
1479
+ "simplify_expression=",
1480
+ method!(RbOptFlags::set_simplify_expression, 1),
1481
+ )?;
1482
+ class.define_method("slice_pushdown", method!(RbOptFlags::get_slice_pushdown, 0))?;
1483
+ class.define_method(
1484
+ "slice_pushdown=",
1485
+ method!(RbOptFlags::set_slice_pushdown, 1),
1486
+ )?;
1487
+ class.define_method(
1488
+ "comm_subplan_elim",
1489
+ method!(RbOptFlags::get_comm_subplan_elim, 0),
1490
+ )?;
1491
+ class.define_method(
1492
+ "comm_subplan_elim=",
1493
+ method!(RbOptFlags::set_comm_subplan_elim, 1),
1494
+ )?;
1495
+ class.define_method(
1496
+ "comm_subexpr_elim",
1497
+ method!(RbOptFlags::get_comm_subexpr_elim, 0),
1498
+ )?;
1499
+ class.define_method(
1500
+ "comm_subexpr_elim=",
1501
+ method!(RbOptFlags::set_comm_subexpr_elim, 1),
1502
+ )?;
1503
+ class.define_method(
1504
+ "check_order_observe",
1505
+ method!(RbOptFlags::get_check_order_observe, 0),
1506
+ )?;
1507
+ class.define_method(
1508
+ "check_order_observe=",
1509
+ method!(RbOptFlags::set_check_order_observe, 1),
1510
+ )?;
1511
+ class.define_method(
1512
+ "fast_projection",
1513
+ method!(RbOptFlags::get_fast_projection, 0),
1514
+ )?;
1515
+ class.define_method(
1516
+ "fast_projection=",
1517
+ method!(RbOptFlags::set_fast_projection, 1),
1518
+ )?;
1519
+ class.define_method("eager", method!(RbOptFlags::get_eager, 0))?;
1520
+ class.define_method("eager=", method!(RbOptFlags::set_eager, 1))?;
1521
+ class.define_method("streaming", method!(RbOptFlags::get_streaming, 0))?;
1522
+ class.define_method("streaming=", method!(RbOptFlags::set_streaming, 1))?;
1523
+
1115
1524
  Ok(())
1116
1525
  }