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

Method test_add_schema

c_glib/test/test-csv-reader.rb:60–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 end
59
60 def test_add_schema
61 options = Arrow::CSVReadOptions.new
62 fields = [
63 Arrow::Field.new("count", Arrow::UInt8DataType.new),
64 Arrow::Field.new("valid", Arrow::BooleanDataType.new),
65 ]
66 schema = Arrow::Schema.new(fields)
67 options.add_schema(schema)
68 table = Arrow::CSVReader.new(open_input(<<-CSV), options)
69count,valid
702,1
719,0
72 CSV
73 columns = {
74 "count" => build_uint8_array([2, 9]),
75 "valid" => build_boolean_array([true, false]),
76 }
77 assert_equal(build_table(columns),
78 table.read)
79 end
80
81 def test_column_types
82 require_gi_bindings(3, 3, 1)

Callers

nothing calls this directly

Calls 3

add_schemaMethod · 0.80
newMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected