Skip to content

Commit 2745fb2

Browse files
committed
minor changes and tzdata to latest
1 parent 32fbc78 commit 2745fb2

10 files changed

Lines changed: 21 additions & 20 deletions

File tree

.github/workflows/r.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ jobs:
280280
- name: Download Timezone Database
281281
shell: bash
282282
run: |
283-
# RTools 40's MinGW GCC may not support C++20 chrono timezones,
283+
# RTools 40 uses GCC 8.x which does not support C++20 chrono timezones,
284284
# so Arrow uses the vendored date library which requires tzdata
285285
ci/scripts/download_tz_database.sh
286286
- run: mkdir r/windows

ci/scripts/download_tz_database.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
set -ex
2121

2222
# Download database
23-
curl https://data.iana.org/time-zones/releases/tzdata2024b.tar.gz --output ~/Downloads/tzdata.tar.gz
23+
curl https://data.iana.org/time-zones/releases/tzdata.tar.gz --output ~/Downloads/tzdata.tar.gz
2424

2525
# Extract
2626
mkdir -p ~/Downloads/tzdata

cpp/src/arrow/compute/kernels/scalar_temporal_test.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "arrow/type_fwd.h"
3030
#include "arrow/type_traits.h"
3131
#include "arrow/util/checked_cast.h"
32-
#include "arrow/util/chrono_internal.h" // for ARROW_USE_STD_CHRONO
3332
#include "arrow/util/formatting.h"
3433
#include "arrow/util/logging_internal.h"
3534

cpp/src/arrow/compute/kernels/temporal_internal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ struct ZonedLocalizer {
165165

166166
template <typename Duration>
167167
struct TimestampFormatter {
168-
const char* format;
168+
const std::string format;
169169
const ArrowTimeZone tz;
170170
std::ostringstream bufstream;
171171

172172
explicit TimestampFormatter(const std::string& format, const ArrowTimeZone time_zone,
173173
const std::locale& locale)
174-
: format(format.c_str()), tz(time_zone) {
174+
: format(format), tz(time_zone) {
175175
bufstream.imbue(locale);
176176
// Propagate errors as C++ exceptions (to get an actual error message)
177177
bufstream.exceptions(std::ios::failbit | std::ios::badbit);
@@ -182,7 +182,7 @@ struct TimestampFormatter {
182182
const auto timepoint = sys_time<Duration>(Duration{arg});
183183
auto format_zoned_time = [&](auto&& zt) {
184184
try {
185-
chrono::to_stream(bufstream, format, zt);
185+
chrono::to_stream(bufstream, format.c_str(), zt);
186186
return Status::OK();
187187
} catch (const std::runtime_error& ex) {
188188
bufstream.clear();

cpp/src/arrow/util/date_internal.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ namespace std::chrono {
6464
namespace arrow_vendored::date {
6565
#endif
6666

67-
using arrow::internal::OffsetZone;
68-
6967
template <>
70-
struct zoned_traits<OffsetZone> {
71-
static OffsetZone default_zone() { return OffsetZone{std::chrono::minutes{0}}; }
68+
struct zoned_traits<arrow::internal::OffsetZone> {
69+
static arrow::internal::OffsetZone default_zone() {
70+
return arrow::internal::OffsetZone{std::chrono::minutes{0}};
71+
}
7272

73-
static OffsetZone locate_zone(const std::string& name) {
73+
static arrow::internal::OffsetZone locate_zone(const std::string& name) {
7474
throw std::runtime_error{"OffsetZone can't parse " + name};
7575
}
7676
};

docs/source/cpp/build_system.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ timezone mapping XML. To download, you can use the following batch script:
245245

246246
.. code-block:: batch
247247
248-
curl https://data.iana.org/time-zones/releases/tzdata2021e.tar.gz --output tzdata.tar.gz
248+
curl https://data.iana.org/time-zones/releases/tzdata.tar.gz --output tzdata.tar.gz
249249
mkdir tzdata
250250
tar --extract --file tzdata.tar.gz --directory tzdata
251251
move tzdata %USERPROFILE%\Downloads\tzdata
@@ -254,7 +254,7 @@ timezone mapping XML. To download, you can use the following batch script:
254254
--output %USERPROFILE%\Downloads\tzdata\windowsZones.xml
255255
256256
By default, the timezone database will be detected at ``%USERPROFILE%\Downloads\tzdata``,
257-
but you can set a custom path at runtime in :struct:`arrow::ArrowGlobalOptions`::
257+
but you can set a custom path at runtime in :struct:`arrow::GlobalOptions`::
258258

259259
arrow::GlobalOptions options;
260260
options.timezone_db_path = "path/to/tzdata";

python/pyarrow/config.pxi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def set_timezone_db_path(path):
117117
warnings.warn(
118118
"pyarrow.set_timezone_db_path is deprecated as of 24.0.0 "
119119
"and will be removed in a future version. PyArrow now uses the "
120-
"operating system's timezone database on Windows.",
120+
"operating system's timezone database on most Windows builds.",
121121
FutureWarning,
122122
stacklevel=2
123123
)

python/pyarrow/tests/test_misc.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,11 @@ def import_arrow():
143143
"on non-Windows platforms")
144144
def test_set_timezone_db_path_non_windows():
145145
# set_timezone_db_path raises an error on non-Windows platforms
146-
with pytest.raises(ArrowInvalid,
147-
match="Arrow was set to use OS timezone "
148-
"database at compile time"):
149-
pa.set_timezone_db_path("path")
146+
with pytest.warns(FutureWarning, match="deprecated"):
147+
with pytest.raises(ArrowInvalid,
148+
match="Arrow was set to use OS timezone "
149+
"database at compile time"):
150+
pa.set_timezone_db_path("path")
150151

151152

152153
@pytest.mark.parametrize('klass', [

python/pyarrow/tests/test_util.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ def test_download_tzdata_on_windows():
220220
# Download timezone database and remove data in case it already exists
221221
if (os.path.exists(tzdata_path)):
222222
shutil.rmtree(tzdata_path)
223-
download_tzdata_on_windows()
223+
with pytest.warns(FutureWarning, match="deprecated"):
224+
download_tzdata_on_windows()
224225

225226
# Inspect the folder
226227
assert os.path.exists(tzdata_path)

python/pyarrow/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def download_tzdata_on_windows():
260260
warnings.warn(
261261
"pyarrow.util.download_tzdata_on_windows is deprecated as of 24.0.0 "
262262
"and will be removed in a future version. PyArrow now uses the "
263-
"operating system's timezone database on Windows.",
263+
"operating system's timezone database on most Windows builds.",
264264
FutureWarning,
265265
stacklevel=2
266266
)

0 commit comments

Comments
 (0)