Conversation
|
|
3e23a57 to
d22fc96
Compare
|
@github-actions crossbow submit verify-rc-source-windows test-build-vcpkg-win |
|
Revision: d22fc96 Submitted crossbow builds: ursacomputing/crossbow @ actions-ef7574f790
|
|
After #51211 is merged we can completely move to the |
|
@github-actions crossbow submit verify-rc-source-windows test-build-vcpkg-win |
|
Revision: ef7d5fe Submitted crossbow builds: ursacomputing/crossbow @ actions-41c0a4fab7
|
ef7d5fe to
a5d7ef9
Compare
|
@github-actions crossbow submit verify-rc-source-windows test-build-vcpkg-win |
|
Revision: a5d7ef9 Submitted crossbow builds: ursacomputing/crossbow @ actions-1c32742fcc
|
b69f711 to
fdcaf7e
Compare
|
@github-actions crossbow submit verify-rc-source-windows test-build-vcpkg-win |
|
@pitrou does approach of this PR make sense? Especialy cpp/src/arrow/util/chrono_config_internal.h. If it does I'll polish it and push it to review. |
|
Revision: fdcaf7e Submitted crossbow builds: ursacomputing/crossbow @ actions-6ed6db4ecf
|
I think it does. |
dd9b10c to
09d3c61
Compare
|
@github-actions crossbow submit test-r-fedora-clang test-r-linux-as-cran test-r-alpine-linux-cran test-r-macos-as-cran r-binary-packages verify-rc-source-windows test-build-vcpkg-win |
|
Revision: 09d3c61 Submitted crossbow builds: ursacomputing/crossbow @ actions-51d00219e4
|
09d3c61 to
6dbcec4
Compare
fa624ed to
dfb9ed7
Compare
- R: skip set_timezone_database when the timezone database is managed by the OS or standard library, avoiding a startup error on MinGW builds - Clarify the Initialize() error message for standard-library backends - Document backend selection caveats (runtime libstdc++, MinGW, installed headers, vendored timezone symbols not exported) - Avoid a global namespace alias in gandiva's epoch_time_point.h - Report an error when TimestampFormatter's stream sentry fails
|
@github-actions crossbow submit test-debian-experimental-cpp-gcc-16 |
|
Revision: 14c50d8 Submitted crossbow builds: ursacomputing/crossbow @ actions-76ecbaf520
|
|
The failure on Testing |
|
@github-actions crossbow submit test-debian-experimental-cpp-gcc-15 |
|
Revision: 14c50d8 Submitted crossbow builds: ursacomputing/crossbow @ actions-3fd704e3af
|
The aim with gcc-16 is to test std::chrono on linux (no other compilers we have on linux will currently use that codepath). I can wait for GH-51329 to merge, rebase and check. I don't really want to add |
|
Agree, sorry if it was not clear, the failures are completely unrelated to this PR and this PR can be reviewed I was just validating the failure was also happening on gcc15. I've opened an issue to fix those failures (which also happen on main) here: |
|
@pitrou I addressed you comments and this is ready for another round. That said - is this change something we would want to merge before the release or rather afterwards? I'd defer to your judgement. |
|
@github-actions crossbow submit -g cpp |
|
Revision: fd2bb12 Submitted crossbow builds: ursacomputing/crossbow @ actions-89610adff7 |
| } | ||
|
|
||
| #if ARROW_USE_STD_CHRONO | ||
| TEST(TimestampFormatterTest, CoalesceChronoFields) { |
There was a problem hiding this comment.
Could you add a comment explaining what this is about?
| } | ||
| #endif | ||
|
|
||
| TEST(TimestampFormatterTest, ReuseFormatter) { |
There was a problem hiding this comment.
Same, explain why this is useful?
| &options_earliest); | ||
| } | ||
|
|
||
| #if ARROW_USE_STD_CHRONO |
There was a problem hiding this comment.
Some of these tests are not compute-specific, can we move them to a more appropriate place? For example arrow/util/time_test.cc
| } | ||
| } | ||
|
|
||
| TEST(TimestampFormatterTest, NanosecondRangeLimits) { |
There was a problem hiding this comment.
Do we test for overflow somewhere?
| EXPECT_EQ(result, "763145224192 ns"); | ||
| } | ||
|
|
||
| TEST(TimestampFormatterTest, StreamState) { |
There was a problem hiding this comment.
What is this for exactly? Is it useful? if so, add a comment?
| const auto append_literal = [&](char value) { | ||
| // Braces and literal percent signs must stay outside chrono replacement fields. | ||
| if (value == '{' || value == '}' || value == '%') close_zoned_field(); | ||
| AppendEscapedLiteral(&out, value); |
There was a problem hiding this comment.
If this is the single call site of AppendEscapedLiteral, perhaps it needn't be a separate function at all?
| ? local_time - local_day | ||
| : std::chrono::days{1} - (local_day - local_time); | ||
| const auto time_of_day_count = time_of_day.count(); | ||
| const std::ostream::sentry sentry(bufstream); |
There was a problem hiding this comment.
Hmm, what is this for/how this snippet work? Can you add explanatory comments?
| std::make_format_args(zt, time_of_day, time_of_day_count)); | ||
| if (end.failed()) bufstream.setstate(std::ios::badbit); | ||
| } else { | ||
| bufstream.setstate(std::ios::badbit); |
|
|
||
| template <typename Duration> | ||
| struct TimestampFormatter { | ||
| static std::string PrepareFormat(const std::string& format) { |
There was a problem hiding this comment.
Can you make this method protected and move it towards the end of the struct for clarity?
| return detail::ToChronoFormat( | ||
| format.c_str(), std::ratio_equal_v<typename Precision::period, std::micro>); |
There was a problem hiding this comment.
Please add parameter name when it's not obvious.
| return detail::ToChronoFormat( | |
| format.c_str(), std::ratio_equal_v<typename Precision::period, std::micro>); | |
| return detail::ToChronoFormat( | |
| format.c_str(), /*xxx=*/ std::ratio_equal_v<typename Precision::period, std::micro>); |
Rationale for this change
Follow up on #48593 / #48601 - migrate remaining uses of
arrow_vendored::datetoarrow::internal::chrono, usingstd::chronowhere supported.What changes are included in this PR?
arrow::internal::chrono.chrono_config_internal.h, which is also used to guard the vendored timezone sources (datetime.cpp,datetime_ios.mm) so standard-library builds don't compile a second timezone implementation.std::chronoon non-Windows with libstdc++ >= 16.2 (earlier versions are affected by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116110 and keep using the vendored library).std::formattranslation intoTimestampFormatter, preserving Arrow's existing strftime syntax (%Q/%q,%n/%t, unknown directives as literals, braces, etc.).set_timezone_databaseis a no-op when the timezone database isn't configurable (e.g. MinGW builds usingstd::chrono).std::chronopath on Linux.Are these changes tested?
Yes. By existing tests, new tests for strftime format translation and formatter stream state, and the new GCC 16 crossbow job.
Are there any user-facing changes?
Yes, for builds that select the
std::chronobackend (MSVC, MinGW with C++20 timezone support, and Linux with libstdc++ >= 16.2):arrow::Initialize()withGlobalOptions::timezone_db_path(deprecated since 24.0.0) now returnsInvalid, andRuntimeInfo::using_os_timezone_dbistrue. On MSVC this means the deprecatedpyarrow.set_timezone_db_pathnow raises instead of silently configuring an unused database.libarrowno longer exports thearrow_vendored::datetimezone functions (locate_zone,current_zone,reload_tzdb, ...) since the vendored timezone sources are not compiled. Downstream code calling these directly will fail to link against such builds. Calendar types inarrow/vendored/datetime.hare header-only and unaffected.arrow/util/chrono_internal.handarrow/util/chrono_config_internal.hare now installed, as they are included by the publicformatting.handvalue_parsing.hheaders.AI disclosure: this was in large part generated by AI. However I am familiar with the codebase somewhat and have reviewed proposed changes manually.