[ 
https://issues.apache.org/jira/browse/ARROW-2180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16373088#comment-16373088
 ] 

ASF GitHub Bot commented on ARROW-2180:
---------------------------------------

wesm closed pull request #1638: ARROW-2180: [C++] Remove deprecated APIs from 
0.8.0 cycle
URL: https://github.com/apache/arrow/pull/1638
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/cpp/src/arrow/array.cc b/cpp/src/arrow/array.cc
index a8043d69b..83142dfef 100644
--- a/cpp/src/arrow/array.cc
+++ b/cpp/src/arrow/array.cc
@@ -140,15 +140,6 @@ PrimitiveArray::PrimitiveArray(const 
std::shared_ptr<DataType>& type, int64_t le
   SetData(ArrayData::Make(type, length, {null_bitmap, data}, null_count, 
offset));
 }
 
-#ifndef ARROW_NO_DEPRECATED_API
-
-const uint8_t* PrimitiveArray::raw_values() const {
-  return raw_values_ +
-         offset() * static_cast<const FixedWidthType&>(*type()).bit_width() / 
CHAR_BIT;
-}
-
-#endif
-
 template <typename T>
 NumericArray<T>::NumericArray(const std::shared_ptr<ArrayData>& data)
     : PrimitiveArray(data) {
@@ -752,17 +743,6 @@ class ArrayDataWrapper {
 
 }  // namespace internal
 
-#ifndef ARROW_NO_DEPRECATED_API
-
-Status MakeArray(const std::shared_ptr<ArrayData>& data, 
std::shared_ptr<Array>* out) {
-  internal::ArrayDataWrapper wrapper_visitor(data, out);
-  RETURN_NOT_OK(VisitTypeInline(*data->type, &wrapper_visitor));
-  DCHECK(out);
-  return Status::OK();
-}
-
-#endif
-
 std::shared_ptr<Array> MakeArray(const std::shared_ptr<ArrayData>& data) {
   std::shared_ptr<Array> out;
   internal::ArrayDataWrapper wrapper_visitor(data, &out);
diff --git a/cpp/src/arrow/array.h b/cpp/src/arrow/array.h
index 5b9ce9a01..faa9211c6 100644
--- a/cpp/src/arrow/array.h
+++ b/cpp/src/arrow/array.h
@@ -146,13 +146,6 @@ struct ARROW_EXPORT ArrayData {
 
   std::shared_ptr<ArrayData> Copy() const { return 
std::make_shared<ArrayData>(*this); }
 
-#ifndef ARROW_NO_DEPRECATED_API
-
-  // Deprecated since 0.8.0
-  std::shared_ptr<ArrayData> ShallowCopy() const { return Copy(); }
-
-#endif
-
   std::shared_ptr<DataType> type;
   int64_t length;
   int64_t null_count;
@@ -161,19 +154,6 @@ struct ARROW_EXPORT ArrayData {
   std::vector<std::shared_ptr<ArrayData>> child_data;
 };
 
-#ifndef ARROW_NO_DEPRECATED_API
-
-/// \brief Create a strongly-typed Array instance from generic ArrayData
-/// \param[in] data the array contents
-/// \param[out] out the resulting Array instance
-/// \return Status
-///
-/// \note Deprecated since 0.8.0
-ARROW_EXPORT
-Status MakeArray(const std::shared_ptr<ArrayData>& data, 
std::shared_ptr<Array>* out);
-
-#endif
-
 /// \brief Create a strongly-typed Array instance from generic ArrayData
 /// \param[in] data the array contents
 /// \return the resulting Array instance
@@ -335,15 +315,6 @@ class ARROW_EXPORT PrimitiveArray : public FlatArray {
   /// Does not account for any slice offset
   std::shared_ptr<Buffer> values() const { return data_->buffers[1]; }
 
-#ifndef ARROW_NO_DEPRECATED_API
-
-  /// \brief Return pointer to start of raw data
-  ///
-  /// \note Deprecated since 0.8.0
-  const uint8_t* raw_values() const;
-
-#endif
-
  protected:
   PrimitiveArray() {}
 
diff --git a/cpp/src/arrow/buffer.h b/cpp/src/arrow/buffer.h
index 74a3c680d..cf25ccd03 100644
--- a/cpp/src/arrow/buffer.h
+++ b/cpp/src/arrow/buffer.h
@@ -371,22 +371,6 @@ ARROW_EXPORT
 Status AllocateResizableBuffer(MemoryPool* pool, const int64_t size,
                                std::shared_ptr<ResizableBuffer>* out);
 
-#ifndef ARROW_NO_DEPRECATED_API
-
-/// \brief Create Buffer referencing std::string memory
-///
-/// Warning: string instance must stay alive
-///
-/// \param str std::string instance
-/// \return std::shared_ptr<Buffer>
-///
-/// \note Deprecated Since 0.8.0
-static inline std::shared_ptr<Buffer> GetBufferFromString(const std::string& 
str) {
-  return std::make_shared<Buffer>(str);
-}
-
-#endif  // ARROW_NO_DEPRECATED_API
-
 }  // namespace arrow
 
 #endif  // ARROW_BUFFER_H
diff --git a/cpp/src/arrow/compare.cc b/cpp/src/arrow/compare.cc
index 9ed54ca3a..69cacbfac 100644
--- a/cpp/src/arrow/compare.cc
+++ b/cpp/src/arrow/compare.cc
@@ -783,30 +783,4 @@ bool TypeEquals(const DataType& left, const DataType& 
right) {
   return are_equal;
 }
 
-Status ArrayEquals(const Array& left, const Array& right, bool* are_equal) {
-  *are_equal = ArrayEquals(left, right);
-  return Status::OK();
-}
-
-Status TensorEquals(const Tensor& left, const Tensor& right, bool* are_equal) {
-  *are_equal = TensorEquals(left, right);
-  return Status::OK();
-}
-
-Status ArrayApproxEquals(const Array& left, const Array& right, bool* 
are_equal) {
-  *are_equal = ArrayApproxEquals(left, right);
-  return Status::OK();
-}
-
-Status ArrayRangeEquals(const Array& left, const Array& right, int64_t 
start_idx,
-                        int64_t end_idx, int64_t other_start_idx, bool* 
are_equal) {
-  *are_equal = ArrayRangeEquals(left, right, start_idx, end_idx, 
other_start_idx);
-  return Status::OK();
-}
-
-Status TypeEquals(const DataType& left, const DataType& right, bool* 
are_equal) {
-  *are_equal = TypeEquals(left, right);
-  return Status::OK();
-}
-
 }  // namespace arrow
diff --git a/cpp/src/arrow/compare.h b/cpp/src/arrow/compare.h
index df3386e4b..956ae897e 100644
--- a/cpp/src/arrow/compare.h
+++ b/cpp/src/arrow/compare.h
@@ -31,33 +31,6 @@ class DataType;
 class Status;
 class Tensor;
 
-#ifndef ARROW_NO_DEPRECATED_API
-/// Returns true if the arrays are exactly equal
-/// \note Deprecated since 0.8.0
-Status ARROW_EXPORT ArrayEquals(const Array& left, const Array& right, bool* 
are_equal);
-
-/// \note Deprecated since 0.8.0
-Status ARROW_EXPORT TensorEquals(const Tensor& left, const Tensor& right,
-                                 bool* are_equal);
-
-/// Returns true if the arrays are approximately equal. For non-floating point
-/// types, this is equivalent to ArrayEquals(left, right)
-/// \note Deprecated since 0.8.0
-Status ARROW_EXPORT ArrayApproxEquals(const Array& left, const Array& right,
-                                      bool* are_equal);
-
-/// Returns true if indicated equal-length segment of arrays is exactly equal
-/// \note Deprecated since 0.8.0
-Status ARROW_EXPORT ArrayRangeEquals(const Array& left, const Array& right,
-                                     int64_t start_idx, int64_t end_idx,
-                                     int64_t other_start_idx, bool* are_equal);
-
-/// Returns true if the type metadata are exactly equal
-/// \note Deprecated since 0.8.0
-Status ARROW_EXPORT TypeEquals(const DataType& left, const DataType& right,
-                               bool* are_equal);
-#endif
-
 /// Returns true if the arrays are exactly equal
 bool ARROW_EXPORT ArrayEquals(const Array& left, const Array& right);
 
diff --git a/cpp/src/arrow/table.cc b/cpp/src/arrow/table.cc
index 62ea32a8d..ed5858624 100644
--- a/cpp/src/arrow/table.cc
+++ b/cpp/src/arrow/table.cc
@@ -388,32 +388,6 @@ bool Table::Equals(const Table& other) const {
   return true;
 }
 
-#ifndef ARROW_NO_DEPRECATED_API
-
-Status MakeTable(const std::shared_ptr<Schema>& schema,
-                 const std::vector<std::shared_ptr<Array>>& arrays,
-                 std::shared_ptr<Table>* table) {
-  // Make sure the length of the schema corresponds to the length of the vector
-  if (schema->num_fields() != static_cast<int>(arrays.size())) {
-    std::stringstream ss;
-    ss << "Schema and Array vector have different lengths: " << 
schema->num_fields()
-       << " != " << arrays.size();
-    return Status::Invalid(ss.str());
-  }
-
-  std::vector<std::shared_ptr<Column>> columns;
-  columns.reserve(schema->num_fields());
-  for (int i = 0; i < schema->num_fields(); i++) {
-    columns.emplace_back(std::make_shared<Column>(schema->field(i), 
arrays[i]));
-  }
-
-  *table = Table::Make(schema, columns);
-
-  return Status::OK();
-}
-
-#endif  // ARROW_NO_DEPRECATED_API
-
 // ----------------------------------------------------------------------
 // Convert a table to a sequence of record batches
 
diff --git a/cpp/src/arrow/table.h b/cpp/src/arrow/table.h
index 6938db1be..7274fca4d 100644
--- a/cpp/src/arrow/table.h
+++ b/cpp/src/arrow/table.h
@@ -244,18 +244,6 @@ ARROW_EXPORT
 Status ConcatenateTables(const std::vector<std::shared_ptr<Table>>& tables,
                          std::shared_ptr<Table>* table);
 
-#ifndef ARROW_NO_DEPRECATED_API
-
-/// \brief Construct table from multiple input tables.
-/// \return Status, fails if any schemas are different
-/// \note Deprecated since 0.8.0
-ARROW_EXPORT
-Status MakeTable(const std::shared_ptr<Schema>& schema,
-                 const std::vector<std::shared_ptr<Array>>& arrays,
-                 std::shared_ptr<Table>* table);
-
-#endif
-
 }  // namespace arrow
 
 #endif  // ARROW_TABLE_H
diff --git a/cpp/src/arrow/type.cc b/cpp/src/arrow/type.cc
index 6574cce50..792d1bfd0 100644
--- a/cpp/src/arrow/type.cc
+++ b/cpp/src/arrow/type.cc
@@ -38,16 +38,6 @@ std::shared_ptr<Field> Field::AddMetadata(
   return std::make_shared<Field>(name_, type_, nullable_, metadata);
 }
 
-#ifndef ARROW_NO_DEPRECATED_API
-
-Status Field::AddMetadata(const std::shared_ptr<const KeyValueMetadata>& 
metadata,
-                          std::shared_ptr<Field>* out) const {
-  *out = AddMetadata(metadata);
-  return Status::OK();
-}
-
-#endif
-
 std::shared_ptr<Field> Field::RemoveMetadata() const {
   return std::make_shared<Field>(name_, type_, nullable_);
 }
@@ -307,16 +297,6 @@ std::shared_ptr<Schema> Schema::AddMetadata(
   return std::make_shared<Schema>(fields_, metadata);
 }
 
-#ifndef ARROW_NO_DEPRECATED_API
-
-Status Schema::AddMetadata(const std::shared_ptr<const KeyValueMetadata>& 
metadata,
-                           std::shared_ptr<Schema>* out) const {
-  *out = AddMetadata(metadata);
-  return Status::OK();
-}
-
-#endif
-
 std::shared_ptr<const KeyValueMetadata> Schema::metadata() const { return 
metadata_; }
 
 std::shared_ptr<Schema> Schema::RemoveMetadata() const {
diff --git a/cpp/src/arrow/type.h b/cpp/src/arrow/type.h
index cfee6fd0e..95f010a8f 100644
--- a/cpp/src/arrow/type.h
+++ b/cpp/src/arrow/type.h
@@ -232,12 +232,6 @@ class ARROW_EXPORT Field {
 
   std::shared_ptr<const KeyValueMetadata> metadata() const { return metadata_; 
}
 
-#ifndef ARROW_NO_DEPRECATED_API
-  /// \note Deprecated since 0.8.0
-  Status AddMetadata(const std::shared_ptr<const KeyValueMetadata>& metadata,
-                     std::shared_ptr<Field>* out) const;
-#endif
-
   std::shared_ptr<Field> AddMetadata(
       const std::shared_ptr<const KeyValueMetadata>& metadata) const;
   std::shared_ptr<Field> RemoveMetadata() const;
@@ -768,12 +762,6 @@ class ARROW_EXPORT Schema {
                   std::shared_ptr<Schema>* out) const;
   Status RemoveField(int i, std::shared_ptr<Schema>* out) const;
 
-#ifndef ARROW_NO_DEPRECATED_API
-  /// \note Deprecated since 0.8.0
-  Status AddMetadata(const std::shared_ptr<const KeyValueMetadata>& metadata,
-                     std::shared_ptr<Schema>* out) const;
-#endif
-
   /// \brief Replace key-value metadata with new metadata
   ///
   /// \param[in] metadata new KeyValueMetadata


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [C++] Remove APIs deprecated in 0.8.0 release
> ---------------------------------------------
>
>                 Key: ARROW-2180
>                 URL: https://issues.apache.org/jira/browse/ARROW-2180
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Wes McKinney
>            Assignee: Wes McKinney
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to