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

Function TestObjectBlockWriteFails

python/pyarrow/src/arrow/python/python_test.cc:488–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486}
487
488Status TestObjectBlockWriteFails() {
489 StringBuilder builder;
490 const char value[] = {'\xf1', '\0'};
491
492 for (int i = 0; i < 1000; ++i) {
493 ASSERT_OK(builder.Append(value, static_cast<int32_t>(strlen(value))));
494 }
495
496 std::shared_ptr<Array> arr;
497 ASSERT_OK(builder.Finish(&arr));
498
499 auto f1 = field("f1", utf8());
500 auto f2 = field("f2", utf8());
501 auto f3 = field("f3", utf8());
502 std::vector<std::shared_ptr<Field>> fields = {f1, f2, f3};
503 std::vector<std::shared_ptr<Array>> cols = {arr, arr, arr};
504
505 auto schema = ::arrow::schema(fields);
506 auto table = Table::Make(schema, cols);
507
508 Status st;
509 Py_BEGIN_ALLOW_THREADS;
510 PyObject* out;
511 PandasOptions options;
512 options.use_threads = true;
513 st = ConvertTableToPandas(options, table, &out);
514 Py_END_ALLOW_THREADS;
515 ASSERT_RAISES(UnknownError, st);
516
517 return Status::OK();
518}
519
520Status TestMixedTypeFails() {
521 OwnedRef list_ref(PyList_New(3));

Callers

nothing calls this directly

Calls 7

ConvertTableToPandasFunction · 0.85
fieldFunction · 0.50
schemaFunction · 0.50
MakeFunction · 0.50
OKFunction · 0.50
AppendMethod · 0.45
FinishMethod · 0.45

Tested by

no test coverage detected