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

[R] R builds failing with error 'Invalid: Timestamps already have a timezone: 'UTC'. Cannot localize to 'UTC'' #35633

Closed
thisisnic opened this issue May 17, 2023 · 7 comments · Fixed by #35671
Assignees
Milestone

Comments

@thisisnic
Copy link
Member

thisisnic commented May 17, 2023

Describe the bug, including details regarding any error messages, version, and platform.

Lots of R builds (e.g. here) are failing with the following error:

Invalid: Timestamps already have a timezone: 'UTC'. Cannot localize to 'UTC'.

which comes from this line in the C++ library:

return Status::Invalid("Timestamps already have a timezone: '", timezone,

This happened since we updated the vendored version of the date library, so perhaps could be related to that?

Component(s)

C++

@thisisnic
Copy link
Member Author

This fails on the nightly builds, but I can't replicate this when locally, or when running it on PRs (see #3561).

@jorisvandenbossche
Copy link
Member

This happened since we updated the vendored version of the date library, so perhaps could be related to that?

Was that done in a specific PR? (to understand what changed)

@jorisvandenbossche
Copy link
Member

I see that this is #35612. Now, that was actually passing on main, so it might also have been triggered by #35449 (which is failing with this on main, and was actually also already failing on the PR ..)

@thisisnic
Copy link
Member Author

Yep, it was in #35612

@jorisvandenbossche
Copy link
Member

My assumption is that the fix of #35449 caused one of the test dates to become UTC, causing the failure. If that's the case, we will need to fix the test I think

@thisisnic
Copy link
Member Author

You're right; it is failing on the CI on that PR, e.g. https://github.com/apache/arrow/actions/runs/4900485911/jobs/8751167526

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented May 17, 2023

Here:

formats <- c(formats, "%a", "%A", "%b", "%B", "%OS", "%I%p", "%r", "%T%z")

This adds the format "%T%z", and that will now actually result in a tz-aware timestamp, while before it didn't parse the timezone correctly (that's the fix in #35449).

And "strptime" dplyr binding ends up calling assume_timezone, which will not work if the timestamp already has a timezone.

@thisisnic thisisnic changed the title [C++] R builds failing with error 'Invalid: Timestamps already have a timezone: 'UTC'. Cannot localize to 'UTC'' [R] R builds failing with error 'Invalid: Timestamps already have a timezone: 'UTC'. Cannot localize to 'UTC'' May 17, 2023
thisisnic pushed a commit that referenced this issue May 18, 2023
…y have a timezone: 'UTC'. Cannot localize to 'UTC'' (#35671)

Alternative approach to #35634.
* Closes: #35633

Authored-by: Dewey Dunnington <dewey@voltrondata.com>
Signed-off-by: Nic Crane <thisisnic@gmail.com>
@thisisnic thisisnic modified the milestones: 12.0.1, 13.0.0 May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment