Skip to content

Commit f94166d

Browse files
committed
Fixes after code review
1 parent db2c03b commit f94166d

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

c_glib/arrow-glib/compute.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7526,7 +7526,7 @@ garrow_list_slice_options_set_property(GObject *object,
75267526
break;
75277527
case PROP_LIST_SLICE_OPTIONS_STOP:
75287528
{
7529-
gint64 stop_value = g_value_get_int64(value);
7529+
auto stop_value = g_value_get_int64(value);
75307530
if (stop_value == GARROW_LIST_SLICE_OPTIONS_STOP_UNSPECIFIED) {
75317531
options->stop = std::nullopt;
75327532
} else {

c_glib/test/test-list-slice-options.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_stop_property
3333
@options.stop = 5
3434
assert_equal(5, @options.stop)
3535
@options.stop = Arrow::LIST_SLICE_OPTIONS_STOP_UNSPECIFIED
36-
assert_equal(LIST_SLICE_OPTIONS_STOP_UNSPECIFIED, @options.stop)
36+
assert_equal(Arrow::LIST_SLICE_OPTIONS_STOP_UNSPECIFIED, @options.stop)
3737
end
3838

3939
def test_step_property

ruby/red-arrow/lib/arrow/list-slice-options.rb

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,34 +31,46 @@ class ListSliceOptions
3131
# Whether to return a FixedSizeListArray. If true _and_ stop is after a
3232
# list element’s length, nil values will be appended to create the requested
3333
# slice size. The default of nil will return the same type which was passed in.
34+
#
35+
# Since: 23.0.0
3436
def return_fixed_size_list
3537
RETURN_FIXED_SIZE_GLIB_TO_RUBY.fetch(
3638
return_fixed_size_list_raw,
3739
return_fixed_size_list_raw)
3840
end
3941

42+
alias_method :return_fixed_size_list_raw=, :return_fixed_size_list=
43+
private :return_fixed_size_list_raw=
44+
4045
# Whether to return a FixedSizeListArray. If true _and_ stop is after a
4146
# list element’s length, nil values will be appended to create the requested
4247
# slice size. The default of nil will return the same type which was passed in.
48+
#
49+
# Since: 23.0.0
4350
def return_fixed_size_list=(return_fixed_size_list)
44-
set_property(
45-
:return_fixed_size_list,
46-
RETURN_FIXED_SIZE_RUBY_TO_GLIB.fetch(
47-
return_fixed_size_list,
48-
return_fixed_size_list))
51+
self.return_fixed_size_list_raw = RETURN_FIXED_SIZE_RUBY_TO_GLIB.fetch(
52+
return_fixed_size_list,
53+
return_fixed_size_list)
4954
end
5055

5156
alias_method :stop_raw, :stop
5257
private :stop_raw
5358

5459
# Optional stop of list slicing. If set to nil, then slice to end.
60+
#
61+
# Since: 23.0.0
5562
def stop
5663
stop_raw == LIST_SLICE_OPTIONS_STOP_UNSPECIFIED ? nil : stop_raw
5764
end
5865

66+
alias_method :stop_raw=, :stop=
67+
private :stop_raw=
68+
5969
# Optional stop of list slicing. If set to nil, then slice to end.
70+
#
71+
# Since: 23.0.0
6072
def stop=(stop)
61-
set_property(:stop, stop.nil? ? LIST_SLICE_OPTIONS_STOP_UNSPECIFIED : stop)
73+
self.stop_raw = stop.nil? ? LIST_SLICE_OPTIONS_STOP_UNSPECIFIED : stop
6274
end
6375
end
6476
end

0 commit comments

Comments
 (0)