Skip to content

Commit

Permalink
apacheGH-40668: [Ruby][CI] Require GLib 2.58 or later for timezone (a…
Browse files Browse the repository at this point in the history
…pache#40669)

### Rationale for this change

GLib 2.58 or later is required for `TimestampDataType`'s timezone support.

### What changes are included in this PR?

Check GLib version.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#40668

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
kou authored Mar 20, 2024
1 parent 921863f commit 4cce720
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ruby/red-arrow/test/helper/omittable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,13 @@ def require_gi(major, minor, micro)
GObjectIntrospection::Version::STRING
omit(message)
end

def require_glib(major, minor, micro)
return if GLib::Version.or_later?(major, minor, micro)
message =
"Require GLib #{major}.#{minor}.#{micro} or later: " +
GLib::Version::STRING
omit(message)
end
end
end
2 changes: 2 additions & 0 deletions ruby/red-arrow/test/test-csv-loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

class CSVLoaderTest < Test::Unit::TestCase
include Helper::Fixture
include Helper::Omittable

def load_csv(input)
Arrow::CSVLoader.load(input, skip_lines: /^#/)
Expand Down Expand Up @@ -249,6 +250,7 @@ def load_csv(data, **options)

sub_test_case(":timestamp_parsers") do
test(":iso8601") do
require_glib(2, 58, 0)
data_type = Arrow::TimestampDataType.new(:second,
GLib::TimeZone.new("UTC"))
timestamps = [
Expand Down

0 comments on commit 4cce720

Please sign in to comment.