Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-44063: [Python] Deprecate the no longer used serialize/deserialize Pyarrow C++ functions #44064

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions python/pyarrow/src/arrow/python/deserialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "arrow/python/serialize.h"
#include "arrow/python/visibility.h"
#include "arrow/status.h"
#include "arrow/util/macros.h"

namespace arrow {

Expand Down Expand Up @@ -55,6 +56,7 @@ struct ARROW_PYTHON_EXPORT SparseTensorCounts {
/// \param[in] src a RandomAccessFile
/// \param[out] out the reconstructed data
/// \return Status
ARROW_DEPRECATED("Deprecated in 18.0.0. Will be removed in 20.0.0")
ARROW_PYTHON_EXPORT
Status ReadSerializedObject(io::RandomAccessFile* src, SerializedPyObject* out);

Expand All @@ -70,6 +72,7 @@ Status ReadSerializedObject(io::RandomAccessFile* src, SerializedPyObject* out);
/// num_csf_tensors * (2 * ndim_csf + 3) + num_buffers in length
/// \param[out] out the reconstructed object
/// \return Status
ARROW_DEPRECATED("Deprecated in 18.0.0. Will be removed in 20.0.0")
ARROW_PYTHON_EXPORT
Status GetSerializedFromComponents(int num_tensors,
const SparseTensorCounts& num_sparse_tensors,
Expand All @@ -88,6 +91,7 @@ Status GetSerializedFromComponents(int num_tensors,
/// \param[out] out The returned object
/// \return Status
/// This acquires the GIL
ARROW_DEPRECATED("Deprecated in 18.0.0. Will be removed in 20.0.0")
ARROW_PYTHON_EXPORT
Status DeserializeObject(PyObject* context, const SerializedPyObject& object,
PyObject* base, PyObject** out);
Expand All @@ -96,9 +100,11 @@ Status DeserializeObject(PyObject* context, const SerializedPyObject& object,
/// \param[in] object Object to deserialize
/// \param[out] out The deserialized tensor
/// \return Status
ARROW_DEPRECATED("Deprecated in 18.0.0. Will be removed in 20.0.0")
ARROW_PYTHON_EXPORT
Status DeserializeNdarray(const SerializedPyObject& object, std::shared_ptr<Tensor>* out);

ARROW_DEPRECATED("Deprecated in 18.0.0. Will be removed in 20.0.0")
ARROW_PYTHON_EXPORT
Status NdarrayFromBuffer(std::shared_ptr<Buffer> src, std::shared_ptr<Tensor>* out);

Expand Down
4 changes: 4 additions & 0 deletions python/pyarrow/src/arrow/python/serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "arrow/python/visibility.h"
#include "arrow/sparse_tensor.h"
#include "arrow/status.h"
#include "arrow/util/macros.h"

// Forward declaring PyObject, see
// https://mail.python.org/pipermail/python-dev/2003-August/037601.html
Expand Down Expand Up @@ -92,13 +93,15 @@ struct ARROW_PYTHON_EXPORT SerializedPyObject {
/// \return Status
///
/// Release GIL before calling
ARROW_DEPRECATED("Deprecated in 18.0.0. Will be removed in 20.0.0")
ARROW_PYTHON_EXPORT
Status SerializeObject(PyObject* context, PyObject* sequence, SerializedPyObject* out);

/// \brief Serialize an Arrow Tensor as a SerializedPyObject.
/// \param[in] tensor Tensor to be serialized
/// \param[out] out The serialized representation
/// \return Status
ARROW_DEPRECATED("Deprecated in 18.0.0. Will be removed in 20.0.0")
ARROW_PYTHON_EXPORT
Status SerializeTensor(std::shared_ptr<Tensor> tensor, py::SerializedPyObject* out);

Expand All @@ -108,6 +111,7 @@ Status SerializeTensor(std::shared_ptr<Tensor> tensor, py::SerializedPyObject* o
/// \param[in] tensor_num_bytes The length of the Tensor data in bytes
/// \param[in] dst The OutputStream to write the Tensor header to
/// \return Status
ARROW_DEPRECATED("Deprecated in 18.0.0. Will be removed in 20.0.0")
ARROW_PYTHON_EXPORT
Status WriteNdarrayHeader(std::shared_ptr<DataType> dtype,
const std::vector<int64_t>& shape, int64_t tensor_num_bytes,
Expand Down
Loading