You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ko...@apache.org on 2019/01/14 20:50:45 UTC

[arrow] branch master updated: ARROW-4228: [GLib] Add garrow_list_data_type_get_field()

This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new a78a3d6  ARROW-4228: [GLib] Add garrow_list_data_type_get_field()
a78a3d6 is described below

commit a78a3d6569271dd31a7dada1470eadd77c8a2e1e
Author: Yosuke Shiro <yo...@gmail.com>
AuthorDate: Tue Jan 15 05:50:33 2019 +0900

    ARROW-4228: [GLib] Add garrow_list_data_type_get_field()
    
    Because we use `get_field()` to get `GArrowField` in composite data type.
    `garrow_list_data_type_get_value_field()` is deprecated.
    
    Author: Yosuke Shiro <yo...@gmail.com>
    
    Closes #3390 from shiro615/glib-deprecated-garrow-list-data-type-get-value-field and squashes the following commits:
    
    112e9e05 <Yosuke Shiro> Fix symbol list entry
    9fb81251 <Yosuke Shiro> Add symbol list entry for 0.13.0 to arrow-glib-docs.xml
    b4dfd288 <Yosuke Shiro> Add garrow_list_data_type_get_field()
    ef7e3c16 <Yosuke Shiro>  Add macros to check version for 0.13.0
---
 c_glib/arrow-glib/composite-data-type.cpp | 17 +++++++++++++++++
 c_glib/arrow-glib/composite-data-type.h   |  6 ++++++
 c_glib/arrow-glib/version.h.in            | 23 +++++++++++++++++++++++
 c_glib/doc/arrow-glib/arrow-glib-docs.xml |  4 ++++
 c_glib/test/test-list-data-type.rb        |  6 +++---
 5 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/c_glib/arrow-glib/composite-data-type.cpp b/c_glib/arrow-glib/composite-data-type.cpp
index 5ddc1c3..675900a 100644
--- a/c_glib/arrow-glib/composite-data-type.cpp
+++ b/c_glib/arrow-glib/composite-data-type.cpp
@@ -88,10 +88,27 @@ garrow_list_data_type_new(GArrowField *field)
  * @list_data_type: A #GArrowListDataType.
  *
  * Returns: (transfer full): The field of value.
+ *
+ * Deprecated: 0.13.0:
+ *   Use garrow_list_data_type_get_field() instead.
  */
 GArrowField *
 garrow_list_data_type_get_value_field(GArrowListDataType *list_data_type)
 {
+  return garrow_list_data_type_get_field(list_data_type);
+}
+
+/**
+ * garrow_list_data_type_get_field:
+ * @list_data_type: A #GArrowListDataType.
+ *
+ * Returns: (transfer full): The field of value.
+ *
+ * Since: 0.13.0
+ */
+GArrowField *
+garrow_list_data_type_get_field(GArrowListDataType *list_data_type)
+{
   auto data_type = GARROW_DATA_TYPE(list_data_type);
   auto arrow_data_type = garrow_data_type_get_raw(data_type);
   auto arrow_list_data_type =
diff --git a/c_glib/arrow-glib/composite-data-type.h b/c_glib/arrow-glib/composite-data-type.h
index f60a9cd..beb3125 100644
--- a/c_glib/arrow-glib/composite-data-type.h
+++ b/c_glib/arrow-glib/composite-data-type.h
@@ -22,6 +22,7 @@
 #include <arrow-glib/basic-array.h>
 #include <arrow-glib/basic-data-type.h>
 #include <arrow-glib/field.h>
+#include <arrow-glib/version.h>
 
 G_BEGIN_DECLS
 
@@ -67,7 +68,12 @@ struct _GArrowListDataTypeClass
 
 GType               garrow_list_data_type_get_type (void) G_GNUC_CONST;
 GArrowListDataType *garrow_list_data_type_new      (GArrowField *field);
+#ifndef GARROW_DISABLE_DEPRECATED
+GARROW_DEPRECATED_IN_0_13_FOR(garrow_list_data_type_get_field)
 GArrowField *garrow_list_data_type_get_value_field (GArrowListDataType *list_data_type);
+#endif
+GARROW_AVAILABLE_IN_0_13
+GArrowField *garrow_list_data_type_get_field (GArrowListDataType *list_data_type);
 
 
 #define GARROW_TYPE_STRUCT_DATA_TYPE (garrow_struct_data_type_get_type())
diff --git a/c_glib/arrow-glib/version.h.in b/c_glib/arrow-glib/version.h.in
index 501827d..827b9c9 100644
--- a/c_glib/arrow-glib/version.h.in
+++ b/c_glib/arrow-glib/version.h.in
@@ -111,6 +111,15 @@
 #endif
 
 /**
+ * GARROW_VERSION_0_13:
+ *
+ * You can use this macro value for compile time API version check.
+ *
+ * Since: 0.13.0
+ */
+#define GARROW_VERSION_0_13 G_ENCODE_VERSION(0, 13)
+
+/**
  * GARROW_VERSION_0_12:
  *
  * You can use this macro value for compile time API version check.
@@ -175,6 +184,20 @@
 
 #define GARROW_AVAILABLE_IN_ALL
 
+#if GARROW_VERSION_MIN_REQUIRED >= GARROW_VERSION_0_13
+#  define GARROW_DEPRECATED_IN_0_13               GARROW_DEPRECATED
+#  define GARROW_DEPRECATED_IN_0_13_FOR(function) GARROW_DEPRECATED_FOR(function)
+#else
+#  define GARROW_DEPRECATED_IN_0_13
+#  define GARROW_DEPRECATED_IN_0_13_FOR(function)
+#endif
+
+#if GARROW_VERSION_MAX_ALLOWED < GARROW_VERSION_0_13
+#  define GARROW_AVAILABLE_IN_0_13 GARROW_UNAVAILABLE(0, 13)
+#else
+#  define GARROW_AVAILABLE_IN_0_13
+#endif
+
 #if GARROW_VERSION_MIN_REQUIRED >= GARROW_VERSION_0_12
 #  define GARROW_DEPRECATED_IN_0_12               GARROW_DEPRECATED
 #  define GARROW_DEPRECATED_IN_0_12_FOR(function) GARROW_DEPRECATED_FOR(function)
diff --git a/c_glib/doc/arrow-glib/arrow-glib-docs.xml b/c_glib/doc/arrow-glib/arrow-glib-docs.xml
index f9f01fe..1016703 100644
--- a/c_glib/doc/arrow-glib/arrow-glib-docs.xml
+++ b/c_glib/doc/arrow-glib/arrow-glib-docs.xml
@@ -163,6 +163,10 @@
     <title>Index of deprecated API</title>
     <xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
   </index>
+  <index id="api-index-0-13-0" role="0.13.0">
+    <title>Index of new symbols in 0.13.0</title>
+    <xi:include href="xml/api-index-0.13.0.xml"><xi:fallback /></xi:include>
+  </index>
   <index id="api-index-0-12-0" role="0.12.0">
     <title>Index of new symbols in 0.12.0</title>
     <xi:include href="xml/api-index-0.12.0.xml"><xi:fallback /></xi:include>
diff --git a/c_glib/test/test-list-data-type.rb b/c_glib/test/test-list-data-type.rb
index 2d96fcb..78df28a 100644
--- a/c_glib/test/test-list-data-type.rb
+++ b/c_glib/test/test-list-data-type.rb
@@ -30,14 +30,14 @@ class TestListDataType < Test::Unit::TestCase
     assert_equal("list<enabled: bool>", @data_type.to_s)
   end
 
-  def test_value_field
+  def test_field
     assert_equal([
                    @field,
                    @field_data_type,
                  ],
                  [
-                   @data_type.value_field,
-                   @data_type.value_field.data_type,
+                   @data_type.field,
+                   @data_type.field.data_type,
                  ])
   end
 end