Divyansh200102 commented on PR #40186:
URL: https://github.com/apache/arrow/pull/40186#issuecomment-1957878137

   I am guessing the checks are failing because of the clang format.
   ```
   +++ /arrow/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc (after 
clang format)
   @@ -1784,8 +1784,7 @@
         "in StrptimeOptions. Null inputs emit null. If a non-null string\n"
         "fails parsing, an error is returned by default.\n"
         "\n"
   -     "**Note:** The strptime kernel currently ignores the %Z specifier for 
any string."
   -     ),
   +     "**Note:** The strptime kernel currently ignores the %Z specifier for 
any string."),
        {"strings"}, "StrptimeOptions", /*options_required=*/true);
    const FunctionDoc assume_timezone_doc{
        "Convert naive timestamp to timezone-aware timestamp",
   /arrow/cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc had 
clang-format style issues
   ninja: build stopped: subcommand failed.
   ``` 
   @rok when I used `clang-format -i compute.rst` command the following changes 
are coming and they seem wrong 
   ```diff
   diff --git a/docs/source/cpp/compute.rst b/docs/source/cpp/compute.rst
   index 2db5988b8..64660ec23 100644
   --- a/docs/source/cpp/compute.rst
   +++ b/docs/source/cpp/compute.rst
   @@ -1,4 +1,4 @@
   -.. Licensed to the Apache Software Foundation (ASF) under one
   +..Licensed to the Apache Software Foundation(ASF) under one
    .. or more contributor license agreements.  See the NOTICE file
    .. distributed with this work for additional information
    .. regarding copyright ownership.  The ASF licenses this file
   @@ -62,44 +62,41 @@ Compute functions can be invoked by name using
    :func:`arrow::compute::CallFunction`::
    
       std::shared_ptr<arrow::Array> numbers_array = ...;
   -   std::shared_ptr<arrow::Scalar> increment = ...;
   -   arrow::Datum incremented_datum;
   +std::shared_ptr<arrow::Scalar> increment = ...;
   +arrow::Datum incremented_datum;
    
   -   ARROW_ASSIGN_OR_RAISE(incremented_datum,
   -                         arrow::compute::CallFunction("add", 
{numbers_array, increment}));
   -   std::shared_ptr<Array> incremented_array = 
std::move(incremented_datum).make_array();
   +ARROW_ASSIGN_OR_RAISE(incremented_datum,
   +                      arrow::compute::CallFunction("add", {numbers_array, 
increment}));
   +std::shared_ptr<Array> incremented_array = 
std::move(incremented_datum).make_array();
    
   -(note this example uses implicit conversion from ``std::shared_ptr<Array>``
   -to ``Datum``)
   +(note this example uses implicit conversion from ``std::shared_ptr<Array>`` 
to ``Datum``)
    
   -Many compute functions are also available directly as concrete APIs, here
   -:func:`arrow::compute::Add`::
   +    Many compute functions are also available directly as concrete APIs,
   +    here : func :`arrow::compute::Add`::
    
   -   std::shared_ptr<arrow::Array> numbers_array = ...;
   -   std::shared_ptr<arrow::Scalar> increment = ...;
   -   arrow::Datum incremented_datum;
   +               std::shared_ptr<arrow::Array> numbers_array = ...;
   +std::shared_ptr<arrow::Scalar> increment = ...;
   +arrow::Datum incremented_datum;
    
   -   ARROW_ASSIGN_OR_RAISE(incremented_datum,
   -                         arrow::compute::Add(numbers_array, increment));
   -   std::shared_ptr<Array> incremented_array = 
std::move(incremented_datum).make_array();
   +ARROW_ASSIGN_OR_RAISE(incremented_datum, arrow::compute::Add(numbers_array, 
increment));
   +std::shared_ptr<Array> incremented_array = 
std::move(incremented_datum).make_array();
    
   -Some functions accept or require an options structure that determines the
   -exact semantics of the function::
   +Some functions accept or
   +    require an options structure that determines the exact semantics of the 
function::
    
   -   ScalarAggregateOptions scalar_aggregate_options;
   -   scalar_aggregate_options.skip_nulls = false;
   +        ScalarAggregateOptions scalar_aggregate_options;
   +scalar_aggregate_options.skip_nulls = false;
    
   -   std::shared_ptr<arrow::Array> array = ...;
   -   arrow::Datum min_max;
   +std::shared_ptr<arrow::Array> array = ...;
   +arrow::Datum min_max;
    
   -   ARROW_ASSIGN_OR_RAISE(min_max,
   -                         arrow::compute::CallFunction("min_max", {array},
   -                                                      
&scalar_aggregate_options));
   +ARROW_ASSIGN_OR_RAISE(min_max, arrow::compute::CallFunction("min_max", 
{array},
   +                                                            
&scalar_aggregate_options));
    
   -   // Unpack struct scalar result (a two-field {"min", "max"} scalar)
   -   std::shared_ptr<arrow::Scalar> min_value, max_value;
   -   min_value = min_max.scalar_as<arrow::StructScalar>().value[0];
   -   max_value = min_max.scalar_as<arrow::StructScalar>().value[1];
   +// Unpack struct scalar result (a two-field {"min", "max"} scalar)
   +std::shared_ptr<arrow::Scalar> min_value, max_value;
   +min_value = min_max.scalar_as<arrow::StructScalar>().value[0];
   +max_value = min_max.scalar_as<arrow::StructScalar>().value[1];
    
    However, :ref:`Grouped Aggregations <grouped-aggregations-group-by>` are
    not invocable via ``CallFunction``.
   @@ -257,12 +254,18 @@ the input to a single output value.
    * \(4) For decimal inputs, the resulting decimal will have the same
      precision and scale. The result is rounded away from zero.
    
   -* \(5) Output is a ``{"min": input type, "max": input type}`` Struct.
   +* \(5) Output is a ``{
   +  "min" : input type, "max" : input type
   +}`` Struct.
    
   -  Of the interval types, only the month interval is supported, as the 
day-time
   -  and month-day-nano types are not sortable.
   +    Of the interval types,
   +    only the month interval is supported,
   +    as the day - time and month - day -
   +        nano types are not sortable.
    
   -* \(6) Output is an array of ``{"mode": input type, "count": Int64}`` 
Struct.
   +            * \(6)Output is an array of ``{
   +  "mode" : input type, "count" : Int64
   +}`` Struct.
      It contains the *N* most common elements in the input, in descending
      order, where *N* is given in :member:`ModeOptions::n`.
      If two values have the same count, the smallest one comes first.
   @@ -394,7 +397,8 @@ equivalents above and reflects how they are implemented 
internally.
    * \(4) For decimal inputs, the resulting decimal will have the same
      precision and scale. The result is rounded away from zero.
    
   -* \(5) Output is a ``{"min": input type, "max": input type}`` Struct array.
   +* \(5) Output is a ``{
   +  "min" : input type, "max" : input type}`` Struct array.
    
      Of the interval types, only the month interval is supported, as the 
day-time
      and month-day-nano types are not sortable.
   @@ -440,8 +444,8 @@ Arithmetic functions
    ~~~~~~~~~~~~~~~~~~~~
    
    These functions expect inputs of numeric type and apply a given arithmetic
   -operation to each element(s) gathered from the input(s).  If any of the
   -input element(s) is null, the corresponding output element is null.
   +operation to each element(s)
   +gathered from the input(s).If any of the input element(s) is null, the 
corresponding output element is null.
    For binary functions, input(s) will be cast to the
    :ref:`common numeric type <common-numeric-type>`
    (and dictionary decoded, if applicable) before the operation is applied.
   @@ -603,13 +607,16 @@ The example values are given for default values of 
``ndigits`` and ``multiple``.
    
+-----------------------+--------------------------------------------------------------+---------------------------+
    | ``round_mode``        | Operation performed                               
           | Example values            |
    
+=======================+==============================================================+===========================+
   -| DOWN                  | Round to nearest integer less than or equal in 
magnitude;    | 3.2 -> 3, 3.7 -> 3,       |
   -|                       | also known as ``floor(x)``                        
           | -3.2 -> -4, -3.7 -> -4    |
   
-+-----------------------+--------------------------------------------------------------+---------------------------+
   -| UP                    | Round to nearest integer greater than or equal in 
magnitude; | 3.2 -> 4, 3.7 -> 4,       |
   -|                       | also known as ``ceil(x)``                         
           | -3.2 -> -3, -3.7 -> -3    |
   
-+-----------------------+--------------------------------------------------------------+---------------------------+
   -| TOWARDS_ZERO          | Get the integral part without fractional digits;  
           | 3.2 -> 3, 3.7 -> 3,       |
   +| DOWN                  | Round to nearest integer less than or equal in 
magnitude;
   +| 3.2->3, 3.7->3, | | | also known as ``floor(x)`` | -3.2->- 4,
   +    -3.7->- 4 |
   +            +-- -- -- -- -- -- -- -- -- -- -- -+-- -- -- -- -- -- -- -- -- 
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --+-- -- -- -- 
-- -- -- -- -- -- -- -- -- -+ |
   +            UP | Round to nearest integer greater than
   +        or equal in magnitude;
   +| 3.2->4, 3.7->4, | | | also known as ``ceil(x)`` | -3.2->- 3,
   +    -3.7->- 3 |
   +        +-- -- -- -- -- -- -- -- -- -- -- -+-- -- -- -- -- -- -- -- -- -- 
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --+-- -- -- -- -- 
-- -- -- -- -- -- -- -- -+ |
   +        TOWARDS_ZERO | Get the integral part without fractional digits;     
        | 3.2 -> 3, 3.7 -> 3,       |
    |                       | also known as ``trunc(x)``                        
           | -3.2 -> -3, -3.7 -> -3    |
    
+-----------------------+--------------------------------------------------------------+---------------------------+
    | TOWARDS_INFINITY      | Round negative values with ``DOWN`` rule,         
           | 3.2 -> 4, 3.7 -> 4,       |
   @@ -1117,7 +1124,8 @@ String Slicing
    This function transforms each sequence of the array to a subsequence, 
according
    to start and stop indices, and a non-zero step (defaulting to 1).  Slicing
    semantics follow Python slicing semantics: the start index is inclusive,
   -the stop index exclusive; if the step is negative, the sequence is followed
   +the stop index exclusive;
   +if the step is negative, the sequence is followed
    in reverse order.
    
    
+--------------------------+------------+-------------------------+-------------------------+--------------------------+---------+
   @@ -1427,26 +1435,30 @@ null input value is converted into a null output 
value.
      is available).
    
    * \(2) The field names of the output type must be the same or a subset of 
the
   -  field names of the input type; they also must have the same order. 
Casting to
   -  a subset of field names "selects" those fields such that each output field
   -  matches the data of the input field with the same name.
   -
   -* \(3) The list offsets are unchanged, the list values are cast from the
   -  input value type to the output value type (if a conversion is
   -  available).
   -
   -* \(4) Offsets are unchanged, the keys and values are cast from respective 
input
   -  to output types (if a conversion is available). If output type is a list 
of
   -  struct, the key field is output as the first field and the value field the
   -  second field, regardless of field names chosen.
   -
   -* \(5) Any input type that can be cast to the resulting extension's storage 
type.
   -  This excludes extension types, unless being cast to the same extension 
type.
   -
   -Temporal component extraction
   -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   -
   -These functions extract datetime components (year, month, day, etc) from 
temporal types.
   +  field names of the input type;
   +they also must have the same order
   +    .Casting to a subset of field names "selects" those fields such that 
each output field
   +        matches the data of the input field with the same name.
   +
   +            * \(3)The list offsets are unchanged,
   +    the list values are cast from the input value type to the output value
   +    type(if a conversion is available)
   +        .
   +
   +            * \(4)Offsets are unchanged,
   +    the keys and values are cast from respective input to output
   +    types(if a conversion is available)
   +        .If output type is a list of struct,
   +    the key field is output as the first field and the value field the 
second field,
   +    regardless of field names chosen.
   +
   +        * \(5)Any input type that can be cast to the resulting
   +    extension's storage type. This excludes extension types,
   +    unless being cast to the same extension type.
   +
   +    Temporal component extraction ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   +
   +    These functions extract datetime components(year, month, day, etc) from 
temporal types.
    For timestamps inputs with non-empty timezone, localized timestamp 
components will be returned.
    
    
+--------------------+------------+-------------------+---------------+----------------------------+-------+
   @@ -1507,7 +1519,8 @@ For timestamps inputs with non-empty timezone, 
localized timestamp components wi
      starts with the first ISO week. ISO week starts on Monday.
      See `ISO 8601 week date definition`_ for more details.
    
   -* \(3) Output is a ``{"iso_year": output type, "iso_week": output type, 
"iso_day_of_week":  output type}`` Struct.
   +* \(3) Output is a ``{
   +  "iso_year" : output type, "iso_week" : output type, "iso_day_of_week" : 
output type}`` Struct.
    
    * \(4) First US week has the majority (4 or more) of its days in January. 
US year
      starts with the first US week. US week starts on Sunday.
   @@ -1517,9 +1530,12 @@ For timestamps inputs with non-empty timezone, 
localized timestamp components wi
      If :member:`WeekOptions::count_from_zero` is true, dates from the current 
year that fall into the last ISO week
      of the previous year are numbered as week 0, else week 52 or 53 if false.
      If :member:`WeekOptions::first_week_is_fully_in_year` is true, the first 
week (week 1) must fully be in January;
   -  else if false, a week that begins on December 29, 30, or 31 is considered 
the first week of the new year.
   +else if false, a week that begins on December 29, 30,
   +    or 31 is considered the first week of the new year.
    
   -* \(6) Output is a ``{"year": int64(), "month": int64(), "day": int64()}`` 
Struct.
   +            * \(6)Output is a ``{
   +  "year" : int64(), "month" : int64(), "day" : int64()
   +}`` Struct.
    
    .. _ISO 8601 week date definition: 
https://en.wikipedia.org/wiki/ISO_week_date#First_week
    
   @@ -1681,7 +1697,8 @@ Associative transforms
    * \(2) Duplicates are removed from the output while the original order is
      maintained.
    
   -* \(3) Output is a ``{"values": input type, "counts": Int64}`` Struct.
   +* \(3) Output is a ``{
   +  "values" : input type, "counts" : Int64}`` Struct.
      Each output element corresponds to a unique value in the input, along
      with the number of times this value has appeared.
    
   
   ``` 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to