Skip to content

Commit a498448

Browse files
authored
Backport PR #51247 on branch 2.0.x (PERF: Construction of a DatetimeIndex from a list of Timestamp with timezone) (#52045)
Backport PR #51247: PERF: Construction of a DatetimeIndex from a list of Timestamp with timezone --------- Co-authored-by: MarcoGorelli <> (cherry picked from commit 3ea1780)
1 parent fea45ba commit a498448

16 files changed

+32
-34
lines changed

.github/workflows/package-checks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-22.04
2121
strategy:
2222
matrix:
23-
extra: ["test", "performance", "timezone", "computation", "fss", "aws", "gcp", "excel", "parquet", "feather", "hdf5", "spss", "postgresql", "mysql", "sql-other", "html", "xml", "plot", "output_formatting", "clipboard", "compression", "all"]
23+
extra: ["test", "performance", "computation", "fss", "aws", "gcp", "excel", "parquet", "feather", "hdf5", "spss", "postgresql", "mysql", "sql-other", "html", "xml", "plot", "output_formatting", "clipboard", "compression", "all"]
2424
fail-fast: false
2525
name: Install Extras - ${{ matrix.extra }}
2626
concurrency:

ci/deps/actions-310-numpydev.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ dependencies:
1818
- python-dateutil
1919
- pytz
2020
- pip
21+
2122
- pip:
2223
- "cython"
2324
- "--extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple"
2425
- "--pre"
2526
- "numpy"
2627
- "scipy"
28+
- "tzdata>=2022.1"

ci/deps/actions-310.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ dependencies:
4949
- scipy
5050
- sqlalchemy
5151
- tabulate
52-
- tzdata>=2022a
5352
- xarray
5453
- xlrd
5554
- xlsxwriter
5655
- zstandard
56+
57+
- pip:
58+
- tzdata>=2022.1

ci/deps/actions-311.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ dependencies:
4949
- scipy
5050
- sqlalchemy
5151
- tabulate
52-
- tzdata>=2022a
5352
- xarray
5453
- xlrd
5554
- xlsxwriter
5655
- zstandard
56+
57+
- pip:
58+
- tzdata>=2022.1

ci/deps/actions-38-downstream_compat.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,6 @@ dependencies:
6868
- pandas-gbq
6969
- pyyaml
7070
- py
71+
72+
- pip:
73+
- tzdata>=2022.1

ci/deps/actions-38-minimum_versions.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ dependencies:
5252
- scipy=1.7.1
5353
- sqlalchemy=1.4.16
5454
- tabulate=0.8.9
55-
- tzdata=2022a
5655
- xarray=0.21.0
5756
- xlrd=2.0.1
5857
- xlsxwriter=1.4.3
5958
- zstandard=0.15.2
6059

6160
- pip:
6261
- pyqt5==5.15.1
62+
- tzdata==2022.1

ci/deps/actions-38.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,6 @@ dependencies:
5353
- xlrd
5454
- xlsxwriter
5555
- zstandard
56+
57+
- pip:
58+
- tzdata>=2022.1

ci/deps/actions-39.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ dependencies:
4949
- scipy
5050
- sqlalchemy
5151
- tabulate
52-
- tzdata>=2022a
5352
- xarray
5453
- xlrd
5554
- xlsxwriter
5655
- zstandard
56+
57+
- pip:
58+
- tzdata>=2022.1

ci/deps/actions-pypy-38.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ dependencies:
2222
- numpy
2323
- python-dateutil
2424
- pytz
25+
26+
- pip:
27+
- tzdata>=2022.1

ci/test_wheels_windows.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pd.test(extra_args=['-m not clipboard and not single_cpu', '--skip-slow', '--ski
33
pd.test(extra_args=['-m not clipboard and single_cpu', '--skip-slow', '--skip-network', '--skip-db'])
44

55
python --version
6-
pip install pytz six numpy python-dateutil
6+
pip install pytz six numpy python-dateutil tzdata>=2022.1
77
pip install hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17
88
pip install --find-links=pandas/dist --no-index pandas
99
python -c "%test_command%"

doc/source/getting_started/install.rst

-19
Original file line numberDiff line numberDiff line change
@@ -308,25 +308,6 @@ Dependency Minimum Version pip ext
308308
`numba <https://github.com/numba/numba>`__ 0.53.1 performance Alternative execution engine for operations that accept ``engine="numba"`` using a JIT compiler that translates Python functions to optimized machine code using the LLVM compiler.
309309
===================================================== ================== ================== ===================================================================================================================================================================================
310310

311-
Timezones
312-
^^^^^^^^^
313-
314-
Installable with ``pip install "pandas[timezone]"``
315-
316-
========================= ========================= =============== =============================================================
317-
Dependency Minimum Version pip extra Notes
318-
========================= ========================= =============== =============================================================
319-
tzdata 2022.1(pypi)/ timezone Allows the use of ``zoneinfo`` timezones with pandas.
320-
2022a(for system tzdata) **Note**: You only need to install the pypi package if your
321-
system does not already provide the IANA tz database.
322-
However, the minimum tzdata version still applies, even if it
323-
is not enforced through an error.
324-
325-
If you would like to keep your system tzdata version updated,
326-
it is recommended to use the ``tzdata`` package from
327-
conda-forge.
328-
========================= ========================= =============== =============================================================
329-
330311
Visualization
331312
^^^^^^^^^^^^^
332313

doc/source/whatsnew/v2.0.0.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ When installing pandas using pip, sets of optional dependencies can also be inst
2525
pip install "pandas[performance, aws]>=2.0.0"
2626
2727
The available extras, found in the :ref:`installation guide<install.dependencies>`, are
28-
``[all, performance, computation, timezone, fss, aws, gcp, excel, parquet, feather, hdf5, spss, postgresql, mysql,
28+
``[all, performance, computation, fss, aws, gcp, excel, parquet, feather, hdf5, spss, postgresql, mysql,
2929
sql-other, html, xml, plot, output_formatting, clipboard, compression, test]`` (:issue:`39164`).
3030

3131
.. _whatsnew_200.enhancements.index_can_hold_numpy_numeric_dtypes:
@@ -653,6 +653,8 @@ If installed, we now require:
653653
+-------------------+-----------------+----------+---------+
654654
| python-dateutil | 2.8.2 | X | X |
655655
+-------------------+-----------------+----------+---------+
656+
| tzdata | 2022.1 | X | X |
657+
+-------------------+-----------------+----------+---------+
656658

657659
For `optional libraries <https://pandas.pydata.org/docs/getting_started/install.html>`_ the general recommendation is to use the latest version.
658660
The following table lists the lowest version per library that is currently being tested throughout the development of pandas.

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ dependencies:
5252
- scipy
5353
- sqlalchemy
5454
- tabulate
55-
- tzdata>=2022a
5655
- xarray
5756
- xlrd
5857
- xlsxwriter
@@ -116,3 +115,4 @@ dependencies:
116115

117116
- pip:
118117
- sphinx-toggleprompt
118+
- tzdata>=2022.1

pyproject.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ dependencies = [
2727
"numpy>=1.21.0; python_version>='3.10'",
2828
"numpy>=1.23.2; python_version>='3.11'",
2929
"python-dateutil>=2.8.2",
30-
"pytz>=2020.1"
30+
"pytz>=2020.1",
31+
"tzdata>=2022.1"
3132
]
3233
classifiers = [
3334
'Development Status :: 5 - Production/Stable',
@@ -57,7 +58,6 @@ matplotlib = "pandas:plotting._matplotlib"
5758
[project.optional-dependencies]
5859
test = ['hypothesis>=6.34.2', 'pytest>=7.0.0', 'pytest-xdist>=2.2.0', 'pytest-asyncio>=0.17.0']
5960
performance = ['bottleneck>=1.3.2', 'numba>=0.53.1', 'numexpr>=2.7.1']
60-
timezone = ['tzdata>=2022.1']
6161
computation = ['scipy>=1.7.1', 'xarray>=0.21.0']
6262
fss = ['fsspec>=2021.07.0']
6363
aws = ['s3fs>=2021.08.0']
@@ -112,7 +112,6 @@ all = ['beautifulsoup4>=4.9.3',
112112
'SQLAlchemy>=1.4.16',
113113
'tables>=3.6.1',
114114
'tabulate>=0.8.9',
115-
'tzdata>=2022.1',
116115
'xarray>=0.21.0',
117116
'xlrd>=2.0.1',
118117
'xlsxwriter>=1.4.3',

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ s3fs>=2021.08.0
4141
scipy
4242
sqlalchemy
4343
tabulate
44-
tzdata>=2022.1
4544
xarray
4645
xlrd
4746
xlsxwriter
@@ -85,4 +84,5 @@ feedparser
8584
pyyaml
8685
requests
8786
sphinx-toggleprompt
87+
tzdata>=2022.1
8888
setuptools>=61.0.0

scripts/validate_min_versions_in_sync.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,9 @@ def get_versions_from_ci(content: list[str]) -> tuple[dict[str, str], dict[str,
7474
continue
7575
elif seen_required and line.strip():
7676
if "==" in line:
77-
package, version = line.strip().split("==")
78-
77+
package, version = line.strip().split("==", maxsplit=1)
7978
else:
80-
package, version = line.strip().split("=")
79+
package, version = line.strip().split("=", maxsplit=1)
8180
package = package[2:]
8281
if package in EXCLUDE_DEPS:
8382
continue

0 commit comments

Comments
 (0)