Sha256: 902abb99b80aab0f4c63baafe999ccc8f5c956c9a8c6f313611be4a4b4992c52

Contents?: true

Size: 495 Bytes

Versions: 30

Compression:

Stored size: 495 Bytes

Contents

module Polars
  # @private
  module ExprDispatch
    private

    def self.included(base)
      base.attr_accessor :_s
      base.singleton_class.attr_accessor :_accessor
    end

    def method_missing(method, ...)
      return super unless self.class.method_defined?(method)

      namespace = self.class._accessor

      s = Utils.wrap_s(_s)
      expr = F.col(s.name)
      expr = expr.send(namespace) if namespace
      s.to_frame.select(expr.send(method, ...)).to_series
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
polars-df-0.15.0-x86_64-linux lib/polars/expr_dispatch.rb
polars-df-0.15.0-x86_64-linux-musl lib/polars/expr_dispatch.rb
polars-df-0.15.0-x86_64-darwin lib/polars/expr_dispatch.rb
polars-df-0.15.0-x64-mingw-ucrt lib/polars/expr_dispatch.rb
polars-df-0.15.0-arm64-darwin lib/polars/expr_dispatch.rb
polars-df-0.15.0-aarch64-linux lib/polars/expr_dispatch.rb
polars-df-0.15.0-aarch64-linux-musl lib/polars/expr_dispatch.rb
polars-df-0.15.0 lib/polars/expr_dispatch.rb
polars-df-0.14.0-x86_64-linux lib/polars/expr_dispatch.rb
polars-df-0.14.0-x86_64-linux-musl lib/polars/expr_dispatch.rb
polars-df-0.14.0-x86_64-darwin lib/polars/expr_dispatch.rb
polars-df-0.14.0-x64-mingw-ucrt lib/polars/expr_dispatch.rb
polars-df-0.14.0-arm64-darwin lib/polars/expr_dispatch.rb
polars-df-0.14.0-aarch64-linux lib/polars/expr_dispatch.rb
polars-df-0.14.0-aarch64-linux-musl lib/polars/expr_dispatch.rb
polars-df-0.14.0 lib/polars/expr_dispatch.rb
polars-df-0.13.0-x86_64-linux lib/polars/expr_dispatch.rb
polars-df-0.13.0-x86_64-linux-musl lib/polars/expr_dispatch.rb
polars-df-0.13.0-x86_64-darwin lib/polars/expr_dispatch.rb
polars-df-0.13.0-x64-mingw-ucrt lib/polars/expr_dispatch.rb