-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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-30117: [C++][Python] Add "Z" to the end of timestamp print string when tz defined #39272
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good. Let's just check that weird zones don't cause issues.
Co-authored-by: Rok Mihevc <[email protected]>
Co-authored-by: Rok Mihevc <[email protected]>
Forgot to ask: does this currently print timestamp's type when printing the array? And if it does can you add a test that it prints the correct timezone. If not we can leave it for the follow-up. |
No, when printing the array there is no info about the type, one should still inspect the type separately: >>> import pyarrow as pa
>>> a = pa.array([0], pa.timestamp('s', tz='+02:00'))
>>> a
<pyarrow.lib.TimestampArray object at 0x131399fc0>
[
1970-01-01 00:00:00Z
]
>>> a.type
TimestampType(timestamp[s, tz=+02:00]) as mentioned on the issue, we can add this if find important. |
If there's an easy way to include timezone it would be great! |
Given this is a completely separate code path (this is something defined in the python repr, not the C++ pretty printer), let's keep that for a separate PR? |
Agreed, let's make another issue for it. |
It would be good to add that to R also, if I am not mistaken. Will create an issue for it 👍 |
Opened an issue for printing timezone information in |
Thanks! |
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit a288364. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 4 possible false positives for unstable benchmarks that are known to sometimes produce them. |
…tring when tz defined (apache#39272) ### What changes are included in this PR? This PR updates the PrettyPrint for Timestamp type so that "Z" is printed at the end of the output string if the timezone has been defined. This way we add minimum information about the values being stored in UTC. ### Are these changes tested? Yes. ### Are there any user-facing changes? There is a change in how `TimestampArray` prints out the data. With this change "Z" would be added to the end of the string if the timezone is defined. * Closes: apache#30117 Lead-authored-by: AlenkaF <[email protected]> Co-authored-by: Alenka Frim <[email protected]> Co-authored-by: Rok Mihevc <[email protected]> Signed-off-by: Joris Van den Bossche <[email protected]>
…tring when tz defined (apache#39272) ### What changes are included in this PR? This PR updates the PrettyPrint for Timestamp type so that "Z" is printed at the end of the output string if the timezone has been defined. This way we add minimum information about the values being stored in UTC. ### Are these changes tested? Yes. ### Are there any user-facing changes? There is a change in how `TimestampArray` prints out the data. With this change "Z" would be added to the end of the string if the timezone is defined. * Closes: apache#30117 Lead-authored-by: AlenkaF <[email protected]> Co-authored-by: Alenka Frim <[email protected]> Co-authored-by: Rok Mihevc <[email protected]> Signed-off-by: Joris Van den Bossche <[email protected]>
…tring when tz defined (apache#39272) ### What changes are included in this PR? This PR updates the PrettyPrint for Timestamp type so that "Z" is printed at the end of the output string if the timezone has been defined. This way we add minimum information about the values being stored in UTC. ### Are these changes tested? Yes. ### Are there any user-facing changes? There is a change in how `TimestampArray` prints out the data. With this change "Z" would be added to the end of the string if the timezone is defined. * Closes: apache#30117 Lead-authored-by: AlenkaF <[email protected]> Co-authored-by: Alenka Frim <[email protected]> Co-authored-by: Rok Mihevc <[email protected]> Signed-off-by: Joris Van den Bossche <[email protected]>
…' when formatting timestamps (#41045) ### What changes are included in this PR? A test that reproduces an issue found by the fuzzer and a fix for it. ### Are these changes tested? - A test - Comments clarifying somethings around `formatting.h` - Increasing the size of the local buffer used to format timestamps The issue was introduced only recently (unreleased): #39272 * GitHub Issue: #41044 Authored-by: Felipe Oliveira Carvalho <[email protected]> Signed-off-by: Felipe Oliveira Carvalho <[email protected]>
…the 'Z' when formatting timestamps (apache#41045) ### What changes are included in this PR? A test that reproduces an issue found by the fuzzer and a fix for it. ### Are these changes tested? - A test - Comments clarifying somethings around `formatting.h` - Increasing the size of the local buffer used to format timestamps The issue was introduced only recently (unreleased): apache#39272 * GitHub Issue: apache#41044 Authored-by: Felipe Oliveira Carvalho <[email protected]> Signed-off-by: Felipe Oliveira Carvalho <[email protected]>
…the 'Z' when formatting timestamps (apache#41045) ### What changes are included in this PR? A test that reproduces an issue found by the fuzzer and a fix for it. ### Are these changes tested? - A test - Comments clarifying somethings around `formatting.h` - Increasing the size of the local buffer used to format timestamps The issue was introduced only recently (unreleased): apache#39272 * GitHub Issue: apache#41044 Authored-by: Felipe Oliveira Carvalho <[email protected]> Signed-off-by: Felipe Oliveira Carvalho <[email protected]>
What changes are included in this PR?
This PR updates the PrettyPrint for Timestamp type so that "Z" is printed at the end of the output string if the timezone has been defined. This way we add minimum information about the values being stored in UTC.
Are these changes tested?
Yes.
Are there any user-facing changes?
There is a change in how
TimestampArray
prints out the data. With this change "Z" would be added to the end of the string if the timezone is defined.