Class: Polars::MetaExpr
- Inherits:
-
Object
- Object
- Polars::MetaExpr
- Defined in:
- lib/polars/meta_expr.rb
Overview
Namespace for expressions on a meta level.
Instance Method Summary collapse
-
#!=(other) ⇒ Boolean
Not equal.
-
#==(other) ⇒ Boolean
Equal.
-
#_as_selector ⇒ Expr
Turn this expression in a selector.
-
#_selector_add(other) ⇒ Expr
Add selectors.
-
#_selector_and(other) ⇒ Expr
& selectors.
-
#_selector_sub(other) ⇒ Expr
Subtract selectors.
-
#eq(other) ⇒ Boolean
Indicate if this expression is the same as another expression.
-
#has_multiple_outputs ⇒ Boolean
Indicate if this expression expands into multiple expressions.
-
#is_column ⇒ Boolean
Indicate if this expression is a basic (non-regex) unaliased column.
-
#is_regex_projection ⇒ Boolean
Indicate if this expression expands to columns that match a regex pattern.
-
#ne(other) ⇒ Boolean
Indicate if this expression is NOT the same as another expression.
-
#output_name ⇒ String
Get the column name that this expression would produce.
-
#pop ⇒ Array
Pop the latest expression and return the input(s) of the popped expression.
-
#root_names ⇒ Array
Get a list with the root column name.
-
#tree_format(return_as_string: false) ⇒ String
Format the expression as a tree.
-
#undo_aliases ⇒ Expr
Undo any renaming operation like
alias
orkeep_name
.
Instance Method Details
#!=(other) ⇒ Boolean
Not equal.
22 23 24 |
# File 'lib/polars/meta_expr.rb', line 22 def !=(other) !(self == other) end |
#==(other) ⇒ Boolean
Equal.
15 16 17 |
# File 'lib/polars/meta_expr.rb', line 15 def ==(other) _rbexpr.(other._rbexpr) end |
#_as_selector ⇒ Expr
Turn this expression in a selector.
177 178 179 |
# File 'lib/polars/meta_expr.rb', line 177 def _as_selector Utils.wrap_expr(_rbexpr.) end |
#_selector_add(other) ⇒ Expr
Add selectors.
184 185 186 |
# File 'lib/polars/meta_expr.rb', line 184 def _selector_add(other) Utils.wrap_expr(_rbexpr.(other._rbexpr)) end |
#_selector_and(other) ⇒ Expr
& selectors.
198 199 200 |
# File 'lib/polars/meta_expr.rb', line 198 def _selector_and(other) Utils.wrap_expr(_rbexpr.(other._rbexpr)) end |
#_selector_sub(other) ⇒ Expr
Subtract selectors.
191 192 193 |
# File 'lib/polars/meta_expr.rb', line 191 def _selector_sub(other) Utils.wrap_expr(_rbexpr.(other._rbexpr)) end |
#eq(other) ⇒ Boolean
Indicate if this expression is the same as another expression.
38 39 40 |
# File 'lib/polars/meta_expr.rb', line 38 def eq(other) _rbexpr.(other._rbexpr) end |
#has_multiple_outputs ⇒ Boolean
Indicate if this expression expands into multiple expressions.
66 67 68 |
# File 'lib/polars/meta_expr.rb', line 66 def has_multiple_outputs _rbexpr. end |
#is_column ⇒ Boolean
Indicate if this expression is a basic (non-regex) unaliased column.
84 85 86 |
# File 'lib/polars/meta_expr.rb', line 84 def is_column _rbexpr. end |
#is_regex_projection ⇒ Boolean
Indicate if this expression expands to columns that match a regex pattern.
96 97 98 |
# File 'lib/polars/meta_expr.rb', line 96 def is_regex_projection _rbexpr. end |
#ne(other) ⇒ Boolean
Indicate if this expression is NOT the same as another expression.
54 55 56 |
# File 'lib/polars/meta_expr.rb', line 54 def ne(other) !eq(other) end |
#output_name ⇒ String
Get the column name that this expression would produce.
119 120 121 |
# File 'lib/polars/meta_expr.rb', line 119 def output_name _rbexpr. end |
#pop ⇒ Array
Pop the latest expression and return the input(s) of the popped expression.
134 135 136 |
# File 'lib/polars/meta_expr.rb', line 134 def pop _rbexpr..map { |e| Utils.wrap_expr(e) } end |
#root_names ⇒ Array
Get a list with the root column name.
155 156 157 |
# File 'lib/polars/meta_expr.rb', line 155 def root_names _rbexpr. end |
#tree_format(return_as_string: false) ⇒ String
Format the expression as a tree.
212 213 214 215 216 217 218 219 220 |
# File 'lib/polars/meta_expr.rb', line 212 def tree_format(return_as_string: false) s = _rbexpr. if return_as_string s else puts s nil end end |
#undo_aliases ⇒ Expr
Undo any renaming operation like alias
or keep_name
.
170 171 172 |
# File 'lib/polars/meta_expr.rb', line 170 def undo_aliases Utils.wrap_expr(_rbexpr.) end |