MCPcopy Create free account
hub / github.com/apache/arrow / try_convert

Method try_convert

ruby/red-arrow/lib/arrow/array.rb:43–62  ·  view source on GitHub ↗

@api private

(value)

Source from the content-addressed store, hash-verified

41
42 # @api private
43 def try_convert(value)
44 case value
45 when ::Array
46 begin
47 new(value)
48 rescue ArgumentError
49 nil
50 end
51 else
52 if value.respond_to?(:to_arrow_array)
53 begin
54 value.to_arrow_array
55 rescue RangeError
56 nil
57 end
58 else
59 nil
60 end
61 end
62 end
63 end
64
65 # @param i [Integer]

Callers

nothing calls this directly

Calls 1

to_arrow_arrayMethod · 0.45

Tested by

no test coverage detected