Skip to content

Commit 97d09a6

Browse files
ellertguitargeek
authored andcommitted
[df] Support libarrow 21
arrow::internal::GenericToStatus → arrow::ToStatus
1 parent 7786787 commit 97d09a6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tree/dataframe/test/datasource_arrow.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <arrow/record_batch.h>
1313
#include <arrow/table.h>
1414
#include <arrow/type.h>
15+
#include <arrow/util/config.h>
1516
#if defined(__GNUC__)
1617
#pragma GCC diagnostic pop
1718
#endif
@@ -21,9 +22,15 @@
2122
#include <iostream>
2223
using namespace arrow;
2324

25+
#if ARROW_VERSION_MAJOR >= 21
26+
#define ASSERT_OK(expr) \
27+
for (::arrow::Status _st = ::arrow::ToStatus((expr)); !_st.ok();) \
28+
FAIL() << "'" ARROW_STRINGIFY(expr) "' failed with " << _st.ToString()
29+
#else
2430
#define ASSERT_OK(expr) \
2531
for (::arrow::Status _st = ::arrow::internal::GenericToStatus((expr)); !_st.ok();) \
2632
FAIL() << "'" ARROW_STRINGIFY(expr) "' failed with " << _st.ToString()
33+
#endif
2734

2835
// Copied from arrow/testing/builder.h
2936
template <typename TYPE, typename C_TYPE = typename TYPE::c_type>

0 commit comments

Comments
 (0)