Sha256: f0675fcd12cac70248ec1aa2eef64d5b9bea776ab5150e2e69dbd99c3177a350

Contents?: true

Size: 1.02 KB

Versions: 68

Compression:

Stored size: 1.02 KB

Contents

module Polars
  # Namespace for expressions on a meta level.
  class MetaExpr
    # @private
    attr_accessor :_rbexpr

    # @private
    def initialize(expr)
      self._rbexpr = expr._rbexpr
    end

    # Equal.
    #
    # @return [Boolean]
    def ==(other)
      _rbexpr.meta_eq(other._rbexpr)
    end

    # Not equal.
    #
    # @return [Boolean]
    def !=(other)
      !(self == other)
    end

    # Pop the latest expression and return the input(s) of the popped expression.
    #
    # @return [Array]
    def pop
      _rbexpr.meta_pop.map { |e| Utils.wrap_expr(e) }
    end

    # Get a list with the root column name.
    #
    # @return [Array]
    def root_names
      _rbexpr.meta_roots
    end

    # Get the column name that this expression would produce.
    #
    # @return [String]
    def output_name
      _rbexpr.meta_output_name
    end

    # Undo any renaming operation like `alias` or `keep_name`.
    #
    # @return [Expr]
    def undo_aliases
      Utils.wrap_expr(_rbexpr.meta_undo_aliases)
    end
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
polars-df-0.8.0-x86_64-linux lib/polars/meta_expr.rb
polars-df-0.8.0-x86_64-darwin lib/polars/meta_expr.rb
polars-df-0.8.0-arm64-darwin lib/polars/meta_expr.rb
polars-df-0.8.0-aarch64-linux lib/polars/meta_expr.rb
polars-df-0.8.0 lib/polars/meta_expr.rb
polars-df-0.7.0-x86_64-linux lib/polars/meta_expr.rb
polars-df-0.7.0-x86_64-darwin lib/polars/meta_expr.rb
polars-df-0.7.0-arm64-darwin lib/polars/meta_expr.rb
polars-df-0.7.0-aarch64-linux lib/polars/meta_expr.rb
polars-df-0.7.0 lib/polars/meta_expr.rb
polars-df-0.6.0-x86_64-linux lib/polars/meta_expr.rb
polars-df-0.6.0-x86_64-darwin lib/polars/meta_expr.rb
polars-df-0.6.0-arm64-darwin lib/polars/meta_expr.rb
polars-df-0.6.0-aarch64-linux lib/polars/meta_expr.rb
polars-df-0.6.0 lib/polars/meta_expr.rb
polars-df-0.5.0-x86_64-linux lib/polars/meta_expr.rb
polars-df-0.5.0-x86_64-darwin lib/polars/meta_expr.rb
polars-df-0.5.0-arm64-darwin lib/polars/meta_expr.rb
polars-df-0.5.0-aarch64-linux lib/polars/meta_expr.rb
polars-df-0.5.0 lib/polars/meta_expr.rb