Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-31315: [C++][Docs] Document that the strptime kernel ignores %Z #40186

Closed
5 changes: 4 additions & 1 deletion cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,10 @@ const FunctionDoc strptime_doc(
("For each string in `strings`, parse it as a timestamp.\n"
"The timestamp unit and the expected string pattern must be given\n"
"in StrptimeOptions. Null inputs emit null. If a non-null string\n"
"fails parsing, an error is returned by default."),
"fails parsing, an error is returned by default.\n"
"\n"
"**Note:** The strptime kernel currently ignores the %Z specifier for any\n"
"string."),
{"strings"}, "StrptimeOptions", /*options_required=*/true);
const FunctionDoc assume_timezone_doc{
"Convert naive timestamp to timezone-aware timestamp",
Expand Down
4 changes: 3 additions & 1 deletion docs/source/cpp/compute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ provided by a concrete function :func:`~arrow::compute::Cast`.
+-----------------+------------+--------------------+------------------+--------------------------------+-------+
| strftime | Unary | Temporal | String | :struct:`StrftimeOptions` | \(1) |
+-----------------+------------+--------------------+------------------+--------------------------------+-------+
| strptime | Unary | String-like | Timestamp | :struct:`StrptimeOptions` | |
| strptime | Unary | String-like | Timestamp | :struct:`StrptimeOptions` | \(2) |
+-----------------+------------+--------------------+------------------+--------------------------------+-------+

The conversions available with ``cast`` are listed below. In all cases, a
Expand All @@ -1343,6 +1343,8 @@ null input value is converted into a null output value.

.. _detailed formatting documentation: https://howardhinnant.github.io/date/date.html#to_stream_formatting

* \(2) The strptime kernel currently ignores the ``%Z`` specifier for any string.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the "for any string" is fully clear (I am also not a good wordsmith, so not directly an alternative)

Something more verbose: ".. ignores the %Z specifier and any string at the matching location" ?

Copy link
Contributor Author

@Divyansh200102 Divyansh200102 Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The strptime kernel presently overlooks the "%Z" specifier along with any string located at the corresponding position within the input."
"The strptime function does not take into account the %Z format specifier, regardless of the characters that follow it."
Maybe one of these? @jorisvandenbossche

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this stalled @Divyansh200102! We sometimes loose track of waiting PRs. I think we should proceed with this, let's just agree on the wording.

"The strptime kernel presently overlooks the "%Z" specifier along with any string located at the corresponding position within the input."

Seems ok to me. What do you think @jorisvandenbossche ?


**Truth value extraction**

+-----------------------------+------------------------------------+--------------+
Expand Down
Loading