def new(dataset, new_opts = EMPTY_HASH)
      opts =
        if new_opts.empty?
          options
        elsif new_opts.key?(:schema)
          options.merge(new_opts).reject { |k, _| k == :input_schema || k == :output_schema }
        else
          options.merge(new_opts)
        end

      self.class.new(dataset, opts)
    end
def new(dataset, new_opts = EMPTY_HASH)
      opts =
        if new_opts.empty?
          options
        elsif new_opts.key?(:schema)
          options.merge(new_opts).reject { |k, _| k == :input_schema || k == :output_schema }
        else
          options.merge(new_opts)
        end

      self.class.new(dataset, opts)
    end
Return a new relation with provided dataset and additional options

 Use this method whenever you need to use dataset API to get a new dataset
 and you want to return a relation back. Typically relation API should be
 enough though. If you find yourself using this method, it might be worth
 to consider reporting an issue that some dataset functionality is not available
 through relation API.

 @example with a new dataset
   users.new(users.dataset.some_method)

 @example with a new dataset and options
   users.new(users.dataset.some_method, other: 'options')

 @param [Object] dataset
 @param [Hash] new_opts Additional options

 @api public