Skip to content

Commit

Permalink
GH-26209: [Ruby] Add support for Ruby 2.5 (#33602)
Browse files Browse the repository at this point in the history
# Which issue does this PR close?

Closes #26209

# Rationale for this change

Ruby 2.5 was EOL but Ubuntu 18.04 still uses Ruby 2.5. Note that Ubuntu 18.04 will reach EOL on 2023-04.

# What changes are included in this PR?

Ruby 2.5 compatible implementation and tests.

# Are these changes tested?

Yes

# Are there any user-facing changes?

No.

* Closes: #26209

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
kou authored Jan 11, 2023
1 parent 1c97ab0 commit 872bbda
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def internal_load_from_uri(uri)
factory.file_system_uri = uri
finish_options = FinishOptions.new
FinishOptions.instance_methods(false).each do |method|
next unless method.end_with?("=")
next unless method.to_s.end_with?("=")
value = options.delete(method[0..-2].to_sym)
next if value.nil?
finish_options.public_send(method, value)
Expand Down
2 changes: 1 addition & 1 deletion ruby/red-arrow/lib/arrow/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def pack
#
# @since 7.0.0
def join(right, keys=nil, type: :inner, left_outputs: nil, right_outputs: nil)
keys ||= column_names.intersection(right.column_names)
keys ||= (column_names & right.column_names)
plan = ExecutePlan.new
left_node = plan.build_source_node(self)
right_node = plan.build_source_node(right)
Expand Down
4 changes: 2 additions & 2 deletions ruby/red-arrow/test/test-table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ def setup
]),
table1.join(table2,
{left: "left_key", right: :right_key},
**{}))
type: :inner))
end

test("keys: {left: [String, Symbol], right: [Symbol, String]}") do
Expand All @@ -1222,7 +1222,7 @@ def setup
left: ["left_key1", :left_key2],
right: [:right_key1, "right_key2"],
},
**{}))
type: :inner))
end

test("type:") do
Expand Down

0 comments on commit 872bbda

Please sign in to comment.