This is an automated email from the ASF dual-hosted git repository.
rok 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 79c72a67f9 GH-38528: [Python][Compute] Describe strptime format
semantics (#38665)
79c72a67f9 is described below
commit 79c72a67f90719fb1af315a9b2b8caa25d667775
Author: Dan Homola <[email protected]>
AuthorDate: Mon Nov 13 14:45:25 2023 +0100
GH-38528: [Python][Compute] Describe strptime format semantics (#38665)
### Rationale for this change
To prevent possible confusion with the compute strptime function, we now
explicitly mention that the C/C++ semantics are followed.
### What changes are included in this PR?
The documentation of the `format` parameter of the `strptime` function is
expanded.
### Are these changes tested?
N/A documentation change only.
### Are there any user-facing changes?
Just the documentation.
* Closes: #38528
Lead-authored-by: Dan Homola <[email protected]>
Co-authored-by: Dan Homola <[email protected]>
Co-authored-by: Rok Mihevc <[email protected]>
Signed-off-by: Rok Mihevc <[email protected]>
---
python/pyarrow/_compute.pyx | 3 +++
1 file changed, 3 insertions(+)
diff --git a/python/pyarrow/_compute.pyx b/python/pyarrow/_compute.pyx
index 25f77d8160..51dfdbf8eb 100644
--- a/python/pyarrow/_compute.pyx
+++ b/python/pyarrow/_compute.pyx
@@ -1682,6 +1682,9 @@ class StrptimeOptions(_StrptimeOptions):
----------
format : str
Pattern for parsing input strings as timestamps, such as "%Y/%m/%d".
+ Note that the semantics of the format follow the C/C++ strptime, not
the Python one.
+ There are differences in behavior, for example how the "%y" placeholder
+ handles years with less than four digits.
unit : str
Timestamp unit of the output.
Accepted values are "s", "ms", "us", "ns".