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

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


The following commit(s) were added to refs/heads/main by this push:
     new 50cc141310 MINOR: [C++] Use Cast() instead of CastTo() for Timestamp 
Scalar in test (#39226)
50cc141310 is described below

commit 50cc141310f5ebb10d018f8e6416fa92ec28a91b
Author: Hyunseok Seo <[email protected]>
AuthorDate: Thu Dec 14 17:35:31 2023 +0900

    MINOR: [C++] Use Cast() instead of CastTo() for Timestamp Scalar in test 
(#39226)
    
    
    
    ### Rationale for this change
    
    Remove legacy code
    
    This is a sub-PR of the PR mentioned below.
    
    * #39060
    
    ### What changes are included in this PR?
    
    * Replace the legacy scalar `CastTo` implementation for Timestamp Scalar in 
test. It was supposed to be resolved in the mentioned PR, but it was missed.
    
    ### Are these changes tested?
    
    Yes. It is passed by existing test cases.
    
    ### Are there any user-facing changes?
    
    No.
    
    Authored-by: Hyunseok Seo <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/src/arrow/scalar_test.cc | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/cpp/src/arrow/scalar_test.cc b/cpp/src/arrow/scalar_test.cc
index 9d40e688f1..ac740f92c8 100644
--- a/cpp/src/arrow/scalar_test.cc
+++ b/cpp/src/arrow/scalar_test.cc
@@ -878,17 +878,17 @@ TEST(TestTimestampScalars, Cast) {
   EXPECT_EQ(convert(TimeUnit::MICRO, TimeUnit::MILLI, 4567), 4);
 
   ASSERT_OK_AND_ASSIGN(auto str,
-                       TimestampScalar(1024, 
timestamp(TimeUnit::MILLI)).CastTo(utf8()));
-  EXPECT_EQ(*str, StringScalar("1970-01-01 00:00:01.024"));
+                       Cast(TimestampScalar(1024, timestamp(TimeUnit::MILLI)), 
utf8()));
+  EXPECT_EQ(*str.scalar(), StringScalar("1970-01-01 00:00:01.024"));
   ASSERT_OK_AND_ASSIGN(auto i64,
-                       TimestampScalar(1024, 
timestamp(TimeUnit::MILLI)).CastTo(int64()));
-  EXPECT_EQ(*i64, Int64Scalar(1024));
+                       Cast(TimestampScalar(1024, timestamp(TimeUnit::MILLI)), 
int64()));
+  EXPECT_EQ(*i64.scalar(), Int64Scalar(1024));
 
   constexpr int64_t kMillisecondsInDay = 86400000;
-  ASSERT_OK_AND_ASSIGN(
-      auto d64, TimestampScalar(1024 * kMillisecondsInDay + 3, 
timestamp(TimeUnit::MILLI))
-                    .CastTo(date64()));
-  EXPECT_EQ(*d64, Date64Scalar(1024 * kMillisecondsInDay));
+  ASSERT_OK_AND_ASSIGN(auto d64, Cast(TimestampScalar(1024 * 
kMillisecondsInDay + 3,
+                                                      
timestamp(TimeUnit::MILLI)),
+                                      date64()));
+  EXPECT_EQ(*d64.scalar(), Date64Scalar(1024 * kMillisecondsInDay));
 }
 
 TEST(TestDurationScalars, Basics) {

Reply via email to