Skip to content

Commit eb25c94

Browse files
committed
Initial commit
1 parent 7ebe6e9 commit eb25c94

5 files changed

Lines changed: 37 additions & 1 deletion

File tree

cpp/src/arrow/ipc/feather.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,9 @@ class ReaderV2 : public Reader {
770770

771771
Result<std::shared_ptr<Reader>> Reader::Open(
772772
const std::shared_ptr<io::RandomAccessFile>& source) {
773+
ARROW_SUPPRESS_DEPRECATION_WARNING
773774
return Reader::Open(source, IpcReadOptions::Defaults());
775+
ARROW_UNSUPPRESS_DEPRECATION_WARNING
774776
}
775777

776778
Result<std::shared_ptr<Reader>> Reader::Open(

cpp/src/arrow/ipc/feather.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "arrow/ipc/options.h"
2929
#include "arrow/type_fwd.h"
3030
#include "arrow/util/compression.h"
31+
#include "arrow/util/macros.h"
3132
#include "arrow/util/visibility.h"
3233

3334
namespace arrow {
@@ -54,6 +55,9 @@ static constexpr const int kFeatherV2Version = 3;
5455

5556
/// \class Reader
5657
/// \brief An interface for reading columns from Feather files
58+
///
59+
/// \note Deprecated in 25.0.0. Feather V2 is the Arrow IPC file format;
60+
/// use arrow::ipc::RecordBatchFileReader instead.
5761
class ARROW_EXPORT Reader {
5862
public:
5963
virtual ~Reader() = default;
@@ -62,6 +66,9 @@ class ARROW_EXPORT Reader {
6266
///
6367
/// \param[in] source a RandomAccessFile instance
6468
/// \return the table reader
69+
/// \deprecated Deprecated in 25.0.0. Use arrow::ipc::RecordBatchFileReader instead.
70+
ARROW_DEPRECATED(
71+
"Deprecated in 25.0.0. Use arrow::ipc::RecordBatchFileReader instead.")
6572
static Result<std::shared_ptr<Reader>> Open(
6673
const std::shared_ptr<io::RandomAccessFile>& source);
6774

@@ -71,6 +78,9 @@ class ARROW_EXPORT Reader {
7178
/// \param[in] source a RandomAccessFile instance
7279
/// \param[in] options IPC Read options
7380
/// \return the table reader
81+
/// \deprecated Deprecated in 25.0.0. Use arrow::ipc::RecordBatchFileReader instead.
82+
ARROW_DEPRECATED(
83+
"Deprecated in 25.0.0. Use arrow::ipc::RecordBatchFileReader instead.")
7484
static Result<std::shared_ptr<Reader>> Open(
7585
const std::shared_ptr<io::RandomAccessFile>& source, const IpcReadOptions& options);
7686

@@ -107,6 +117,11 @@ class ARROW_EXPORT Reader {
107117
std::shared_ptr<Table>* out) = 0;
108118
};
109119

120+
/// \struct WriteProperties
121+
/// \brief Options for writing Feather files
122+
///
123+
/// \note Deprecated in 25.0.0. Feather V2 is the Arrow IPC file format;
124+
/// use arrow::ipc::MakeFileWriter with arrow::ipc::IpcWriteOptions instead.
110125
struct ARROW_EXPORT WriteProperties {
111126
static WriteProperties Defaults();
112127

@@ -141,6 +156,11 @@ struct ARROW_EXPORT WriteProperties {
141156
int compression_level = ::arrow::util::kUseDefaultCompressionLevel;
142157
};
143158

159+
/// \brief Write a Table to a Feather file
160+
///
161+
/// \deprecated Deprecated in 25.0.0. Feather V2 is the Arrow IPC file format;
162+
/// use arrow::ipc::MakeFileWriter instead.
163+
ARROW_DEPRECATED("Deprecated in 25.0.0. Use arrow::ipc::MakeFileWriter instead.")
144164
ARROW_EXPORT
145165
Status WriteTable(const Table& table, io::OutputStream* dst,
146166
const WriteProperties& properties = WriteProperties::Defaults());

cpp/src/arrow/ipc/feather_test.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ using internal::checked_cast;
4444
namespace ipc {
4545
namespace feather {
4646

47+
// These tests intentionally exercise the deprecated Feather API, supressing
48+
// the deprecation warnings for the whole file.
49+
ARROW_SUPPRESS_DEPRECATION_WARNING
50+
4751
struct TestParam {
4852
TestParam(int arg_version,
4953
Compression::type arg_compression = Compression::UNCOMPRESSED)
@@ -383,6 +387,8 @@ TEST_P(TestFeatherRoundTrip, RoundTrip) {
383387
INSTANTIATE_TEST_SUITE_P(FeatherRoundTripTests, TestFeatherRoundTrip,
384388
::testing::ValuesIn(kBatchCases));
385389

390+
ARROW_UNSUPPRESS_DEPRECATION_WARNING
391+
386392
} // namespace feather
387393
} // namespace ipc
388394
} // namespace arrow

python/pyarrow/includes/libarrow_feather.pxd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ from pyarrow.includes.libarrow cimport (CCompressionType, CStatus, CTable,
2323
c_string, CIpcReadOptions)
2424

2525

26+
# NOTE: these feather C++ APIs are deprecated. Pyarrow still binds them,
27+
# the user-facing FutureWarning lives in pyarrow/feather.py (GH-49232).
2628
cdef extern from "arrow/ipc/api.h" namespace "arrow::ipc" nogil:
2729
int kFeatherV1Version" arrow::ipc::feather::kFeatherV1Version"
2830
int kFeatherV2Version" arrow::ipc::feather::kFeatherV2Version"

r/src/feather.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ void ipc___WriteFeather__Table(const std::shared_ptr<arrow::io::OutputStream>& s
3636
if (compression_level != -1) {
3737
properties.compression_level = compression_level;
3838
}
39+
ARROW_SUPPRESS_DEPRECATION_WARNING
3940
StopIfNotOk(arrow::ipc::feather::WriteTable(*table, stream.get(), properties));
41+
ARROW_UNSUPPRESS_DEPRECATION_WARNING
4042
}
4143

4244
// ----------- Reader
@@ -83,7 +85,11 @@ std::shared_ptr<arrow::Table> ipc___feather___Reader__Read(
8385
std::shared_ptr<arrow::ipc::feather::Reader> ipc___feather___Reader__Open(
8486
const std::shared_ptr<arrow::io::RandomAccessFile>& stream) {
8587
auto result = RunWithCapturedRIfPossible<std::shared_ptr<arrow::ipc::feather::Reader>>(
86-
[&]() { return arrow::ipc::feather::Reader::Open(stream); });
88+
[&]() {
89+
ARROW_SUPPRESS_DEPRECATION_WARNING
90+
return arrow::ipc::feather::Reader::Open(stream);
91+
ARROW_UNSUPPRESS_DEPRECATION_WARNING
92+
});
8793
return ValueOrStop(result);
8894
}
8995

0 commit comments

Comments
 (0)