You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by xu...@apache.org on 2025/04/14 05:45:43 UTC
(iceberg-cpp) branch main updated: chore: don't include expected.h but result.h (#69)
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-cpp.git
The following commit(s) were added to refs/heads/main by this push:
new 5ba0a84 chore: don't include expected.h but result.h (#69)
5ba0a84 is described below
commit 5ba0a846938963bdbc7099e044158f0e3d0af31f
Author: Junwang Zhao <zh...@gmail.com>
AuthorDate: Mon Apr 14 13:45:39 2025 +0800
chore: don't include expected.h but result.h (#69)
It is suggested that we include result.h instead of expected.h so that
in the future we can simply replace this ported iceberg::expected with
std::expected.
Besides that, I fix some IWYU warning in this PR.
---
src/iceberg/arrow/arrow_error_transform_internal.h | 1 -
src/iceberg/json_internal.cc | 3 +--
src/iceberg/json_internal.h | 2 --
src/iceberg/partition_field.cc | 2 +-
src/iceberg/partition_field.h | 1 -
src/iceberg/partition_spec.cc | 2 +-
src/iceberg/schema_field.cc | 2 +-
src/iceberg/schema_internal.cc | 1 -
src/iceberg/schema_internal.h | 1 -
src/iceberg/sort_field.cc | 3 +--
src/iceberg/sort_field.h | 2 --
src/iceberg/sort_order.cc | 2 +-
src/iceberg/transform.h | 1 -
src/iceberg/type.cc | 3 +--
test/json_internal_test.cc | 2 +-
test/partition_field_test.cc | 2 +-
test/partition_spec_test.cc | 2 +-
test/schema_field_test.cc | 2 +-
test/schema_test.cc | 2 +-
test/sort_field_test.cc | 2 +-
test/sort_order_test.cc | 2 +-
test/transform_test.cc | 2 +-
test/type_test.cc | 2 +-
23 files changed, 16 insertions(+), 28 deletions(-)
diff --git a/src/iceberg/arrow/arrow_error_transform_internal.h b/src/iceberg/arrow/arrow_error_transform_internal.h
index 73255c0..60ff72b 100644
--- a/src/iceberg/arrow/arrow_error_transform_internal.h
+++ b/src/iceberg/arrow/arrow_error_transform_internal.h
@@ -22,7 +22,6 @@
#include <arrow/result.h>
#include <arrow/status.h>
-#include "iceberg/expected.h"
#include "iceberg/result.h"
namespace iceberg::arrow {
diff --git a/src/iceberg/json_internal.cc b/src/iceberg/json_internal.cc
index c6fe570..d69b462 100644
--- a/src/iceberg/json_internal.cc
+++ b/src/iceberg/json_internal.cc
@@ -24,7 +24,6 @@
#include <nlohmann/json.hpp>
-#include "iceberg/expected.h"
#include "iceberg/partition_spec.h"
#include "iceberg/result.h"
#include "iceberg/schema.h"
@@ -32,7 +31,7 @@
#include "iceberg/sort_order.h"
#include "iceberg/transform.h"
#include "iceberg/type.h"
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
#include "iceberg/util/macros.h"
namespace iceberg {
diff --git a/src/iceberg/json_internal.h b/src/iceberg/json_internal.h
index 005b05f..4e754fd 100644
--- a/src/iceberg/json_internal.h
+++ b/src/iceberg/json_internal.h
@@ -20,11 +20,9 @@
#pragma once
#include <memory>
-#include <string_view>
#include <nlohmann/json_fwd.hpp>
-#include "iceberg/expected.h"
#include "iceberg/result.h"
#include "iceberg/type_fwd.h"
diff --git a/src/iceberg/partition_field.cc b/src/iceberg/partition_field.cc
index 59e6afc..741fcaf 100644
--- a/src/iceberg/partition_field.cc
+++ b/src/iceberg/partition_field.cc
@@ -23,7 +23,7 @@
#include "iceberg/transform.h"
#include "iceberg/type.h"
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
namespace iceberg {
diff --git a/src/iceberg/partition_field.h b/src/iceberg/partition_field.h
index e31be91..daec404 100644
--- a/src/iceberg/partition_field.h
+++ b/src/iceberg/partition_field.h
@@ -26,7 +26,6 @@
#include <memory>
#include <string>
#include <string_view>
-#include <vector>
#include "iceberg/iceberg_export.h"
#include "iceberg/type_fwd.h"
diff --git a/src/iceberg/partition_spec.cc b/src/iceberg/partition_spec.cc
index 6b86750..40a1190 100644
--- a/src/iceberg/partition_spec.cc
+++ b/src/iceberg/partition_spec.cc
@@ -23,7 +23,7 @@
#include "iceberg/schema.h"
#include "iceberg/type.h"
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
namespace iceberg {
diff --git a/src/iceberg/schema_field.cc b/src/iceberg/schema_field.cc
index 28081a7..9edf0a4 100644
--- a/src/iceberg/schema_field.cc
+++ b/src/iceberg/schema_field.cc
@@ -22,7 +22,7 @@
#include <format>
#include "iceberg/type.h"
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
namespace iceberg {
diff --git a/src/iceberg/schema_internal.cc b/src/iceberg/schema_internal.cc
index a00c0a1..69d7b82 100644
--- a/src/iceberg/schema_internal.cc
+++ b/src/iceberg/schema_internal.cc
@@ -24,7 +24,6 @@
#include <optional>
#include <string>
-#include "iceberg/expected.h"
#include "iceberg/schema.h"
#include "iceberg/type.h"
diff --git a/src/iceberg/schema_internal.h b/src/iceberg/schema_internal.h
index de0283f..0a376cc 100644
--- a/src/iceberg/schema_internal.h
+++ b/src/iceberg/schema_internal.h
@@ -23,7 +23,6 @@
#include <nanoarrow/nanoarrow.h>
-#include "iceberg/expected.h"
#include "iceberg/result.h"
#include "iceberg/type_fwd.h"
diff --git a/src/iceberg/sort_field.cc b/src/iceberg/sort_field.cc
index b96d015..e121826 100644
--- a/src/iceberg/sort_field.cc
+++ b/src/iceberg/sort_field.cc
@@ -22,8 +22,7 @@
#include <format>
#include "iceberg/transform.h"
-#include "iceberg/type.h"
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
namespace iceberg {
diff --git a/src/iceberg/sort_field.h b/src/iceberg/sort_field.h
index 2687914..3ca7062 100644
--- a/src/iceberg/sort_field.h
+++ b/src/iceberg/sort_field.h
@@ -26,9 +26,7 @@
#include <memory>
#include <string>
#include <string_view>
-#include <vector>
-#include "iceberg/expected.h"
#include "iceberg/iceberg_export.h"
#include "iceberg/result.h"
#include "iceberg/type_fwd.h"
diff --git a/src/iceberg/sort_order.cc b/src/iceberg/sort_order.cc
index 232d099..a85dcf1 100644
--- a/src/iceberg/sort_order.cc
+++ b/src/iceberg/sort_order.cc
@@ -21,7 +21,7 @@
#include <format>
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
namespace iceberg {
diff --git a/src/iceberg/transform.h b/src/iceberg/transform.h
index 05d6799..7ca4abc 100644
--- a/src/iceberg/transform.h
+++ b/src/iceberg/transform.h
@@ -26,7 +26,6 @@
#include <variant>
#include "iceberg/arrow_c_data.h"
-#include "iceberg/expected.h"
#include "iceberg/iceberg_export.h"
#include "iceberg/result.h"
#include "iceberg/type_fwd.h"
diff --git a/src/iceberg/type.cc b/src/iceberg/type.cc
index 0a7ab4c..e594a12 100644
--- a/src/iceberg/type.cc
+++ b/src/iceberg/type.cc
@@ -21,10 +21,9 @@
#include <format>
#include <iterator>
-#include <stdexcept>
#include "iceberg/exception.h"
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
namespace iceberg {
diff --git a/test/json_internal_test.cc b/test/json_internal_test.cc
index ff6361d..10b25f5 100644
--- a/test/json_internal_test.cc
+++ b/test/json_internal_test.cc
@@ -30,7 +30,7 @@
#include "iceberg/sort_field.h"
#include "iceberg/sort_order.h"
#include "iceberg/transform.h"
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
namespace iceberg {
diff --git a/test/partition_field_test.cc b/test/partition_field_test.cc
index 11f2247..3140016 100644
--- a/test/partition_field_test.cc
+++ b/test/partition_field_test.cc
@@ -25,7 +25,7 @@
#include <iceberg/type.h>
#include "iceberg/transform.h"
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
namespace iceberg {
diff --git a/test/partition_spec_test.cc b/test/partition_spec_test.cc
index b60e288..6c2cd59 100644
--- a/test/partition_spec_test.cc
+++ b/test/partition_spec_test.cc
@@ -28,7 +28,7 @@
#include "iceberg/partition_field.h"
#include "iceberg/schema.h"
#include "iceberg/transform.h"
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
namespace iceberg {
diff --git a/test/schema_field_test.cc b/test/schema_field_test.cc
index 06b1df6..76833a9 100644
--- a/test/schema_field_test.cc
+++ b/test/schema_field_test.cc
@@ -25,7 +25,7 @@
#include <gtest/gtest.h>
#include "iceberg/type.h"
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
TEST(SchemaFieldTest, Basics) {
{
diff --git a/test/schema_test.cc b/test/schema_test.cc
index 4340194..88dde5b 100644
--- a/test/schema_test.cc
+++ b/test/schema_test.cc
@@ -26,7 +26,7 @@
#include <gtest/gtest.h>
#include "iceberg/schema_field.h"
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
TEST(SchemaTest, Basics) {
{
diff --git a/test/sort_field_test.cc b/test/sort_field_test.cc
index 0a8c407..e0bd7f1 100644
--- a/test/sort_field_test.cc
+++ b/test/sort_field_test.cc
@@ -25,7 +25,7 @@
#include "iceberg/transform.h"
#include "iceberg/type.h"
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
namespace iceberg {
diff --git a/test/sort_order_test.cc b/test/sort_order_test.cc
index 310a013..c759e92 100644
--- a/test/sort_order_test.cc
+++ b/test/sort_order_test.cc
@@ -27,7 +27,7 @@
#include "iceberg/schema.h"
#include "iceberg/sort_field.h"
#include "iceberg/transform.h"
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
namespace iceberg {
diff --git a/test/transform_test.cc b/test/transform_test.cc
index 9d3f36d..fb7b866 100644
--- a/test/transform_test.cc
+++ b/test/transform_test.cc
@@ -26,7 +26,7 @@
#include <gtest/gtest.h>
#include "iceberg/type.h"
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
namespace iceberg {
diff --git a/test/type_test.cc b/test/type_test.cc
index 0fc9a0a..607ddd5 100644
--- a/test/type_test.cc
+++ b/test/type_test.cc
@@ -28,7 +28,7 @@
#include <gtest/gtest.h>
#include "iceberg/exception.h"
-#include "iceberg/util/formatter.h"
+#include "iceberg/util/formatter.h" // IWYU pragma: keep
struct TypeTestCase {
/// Test case name, must be safe for Googletest (alphanumeric + underscore)