From a498448f71427ae234b0892ff5b3180b2b0b0374 Mon Sep 17 00:00:00 2001 From: Marco Edward Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Fri, 17 Mar 2023 13:44:07 +0000 Subject: [PATCH] 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 3ea17805b072d575d1f55f50fe0027d0fdb9b985) --- .github/workflows/package-checks.yml | 2 +- ci/deps/actions-310-numpydev.yaml | 2 ++ ci/deps/actions-310.yaml | 4 +++- ci/deps/actions-311.yaml | 4 +++- ci/deps/actions-38-downstream_compat.yaml | 3 +++ ci/deps/actions-38-minimum_versions.yaml | 2 +- ci/deps/actions-38.yaml | 3 +++ ci/deps/actions-39.yaml | 4 +++- ci/deps/actions-pypy-38.yaml | 3 +++ ci/test_wheels_windows.bat | 2 +- doc/source/getting_started/install.rst | 19 ------------------- doc/source/whatsnew/v2.0.0.rst | 4 +++- environment.yml | 2 +- pyproject.toml | 5 ++--- requirements-dev.txt | 2 +- scripts/validate_min_versions_in_sync.py | 5 ++--- 16 files changed, 32 insertions(+), 34 deletions(-) diff --git a/.github/workflows/package-checks.yml b/.github/workflows/package-checks.yml index a1402603e2140..fa1b5e5d4fba3 100644 --- a/.github/workflows/package-checks.yml +++ b/.github/workflows/package-checks.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - 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"] + extra: ["test", "performance", "computation", "fss", "aws", "gcp", "excel", "parquet", "feather", "hdf5", "spss", "postgresql", "mysql", "sql-other", "html", "xml", "plot", "output_formatting", "clipboard", "compression", "all"] fail-fast: false name: Install Extras - ${{ matrix.extra }} concurrency: diff --git a/ci/deps/actions-310-numpydev.yaml b/ci/deps/actions-310-numpydev.yaml index d1c4338f1806e..ce9d656adc16a 100644 --- a/ci/deps/actions-310-numpydev.yaml +++ b/ci/deps/actions-310-numpydev.yaml @@ -18,9 +18,11 @@ dependencies: - python-dateutil - pytz - pip + - pip: - "cython" - "--extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple" - "--pre" - "numpy" - "scipy" + - "tzdata>=2022.1" diff --git a/ci/deps/actions-310.yaml b/ci/deps/actions-310.yaml index 7a28bd7a35576..5238bc4966e6b 100644 --- a/ci/deps/actions-310.yaml +++ b/ci/deps/actions-310.yaml @@ -49,8 +49,10 @@ dependencies: - scipy - sqlalchemy - tabulate - - tzdata>=2022a - xarray - xlrd - xlsxwriter - zstandard + + - pip: + - tzdata>=2022.1 diff --git a/ci/deps/actions-311.yaml b/ci/deps/actions-311.yaml index 293d1baf86070..72417b8ff6dea 100644 --- a/ci/deps/actions-311.yaml +++ b/ci/deps/actions-311.yaml @@ -49,8 +49,10 @@ dependencies: - scipy - sqlalchemy - tabulate - - tzdata>=2022a - xarray - xlrd - xlsxwriter - zstandard + + - pip: + - tzdata>=2022.1 diff --git a/ci/deps/actions-38-downstream_compat.yaml b/ci/deps/actions-38-downstream_compat.yaml index 0368be8e82b20..ddca181f3e584 100644 --- a/ci/deps/actions-38-downstream_compat.yaml +++ b/ci/deps/actions-38-downstream_compat.yaml @@ -68,3 +68,6 @@ dependencies: - pandas-gbq - pyyaml - py + + - pip: + - tzdata>=2022.1 diff --git a/ci/deps/actions-38-minimum_versions.yaml b/ci/deps/actions-38-minimum_versions.yaml index 9614a72a59d2a..194b59b5abcf2 100644 --- a/ci/deps/actions-38-minimum_versions.yaml +++ b/ci/deps/actions-38-minimum_versions.yaml @@ -52,7 +52,6 @@ dependencies: - scipy=1.7.1 - sqlalchemy=1.4.16 - tabulate=0.8.9 - - tzdata=2022a - xarray=0.21.0 - xlrd=2.0.1 - xlsxwriter=1.4.3 @@ -60,3 +59,4 @@ dependencies: - pip: - pyqt5==5.15.1 + - tzdata==2022.1 diff --git a/ci/deps/actions-38.yaml b/ci/deps/actions-38.yaml index 184eade405458..18ce9dbfcd629 100644 --- a/ci/deps/actions-38.yaml +++ b/ci/deps/actions-38.yaml @@ -53,3 +53,6 @@ dependencies: - xlrd - xlsxwriter - zstandard + + - pip: + - tzdata>=2022.1 diff --git a/ci/deps/actions-39.yaml b/ci/deps/actions-39.yaml index 749cfbc52f88f..6b4331b8a1802 100644 --- a/ci/deps/actions-39.yaml +++ b/ci/deps/actions-39.yaml @@ -49,8 +49,10 @@ dependencies: - scipy - sqlalchemy - tabulate - - tzdata>=2022a - xarray - xlrd - xlsxwriter - zstandard + + - pip: + - tzdata>=2022.1 diff --git a/ci/deps/actions-pypy-38.yaml b/ci/deps/actions-pypy-38.yaml index 0231b46bdc69e..78ab32d6e7830 100644 --- a/ci/deps/actions-pypy-38.yaml +++ b/ci/deps/actions-pypy-38.yaml @@ -22,3 +22,6 @@ dependencies: - numpy - python-dateutil - pytz + + - pip: + - tzdata>=2022.1 diff --git a/ci/test_wheels_windows.bat b/ci/test_wheels_windows.bat index ae7869d63b1ff..ba6cfef8f2dfb 100644 --- a/ci/test_wheels_windows.bat +++ b/ci/test_wheels_windows.bat @@ -3,7 +3,7 @@ pd.test(extra_args=['-m not clipboard and not single_cpu', '--skip-slow', '--ski pd.test(extra_args=['-m not clipboard and single_cpu', '--skip-slow', '--skip-network', '--skip-db']) python --version -pip install pytz six numpy python-dateutil +pip install pytz six numpy python-dateutil tzdata>=2022.1 pip install hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 pip install --find-links=pandas/dist --no-index pandas python -c "%test_command%" diff --git a/doc/source/getting_started/install.rst b/doc/source/getting_started/install.rst index c1295df53fc2b..8a2d5ad418c40 100644 --- a/doc/source/getting_started/install.rst +++ b/doc/source/getting_started/install.rst @@ -308,25 +308,6 @@ Dependency Minimum Version pip ext `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. ===================================================== ================== ================== =================================================================================================================================================================================== -Timezones -^^^^^^^^^ - -Installable with ``pip install "pandas[timezone]"`` - -========================= ========================= =============== ============================================================= -Dependency Minimum Version pip extra Notes -========================= ========================= =============== ============================================================= -tzdata 2022.1(pypi)/ timezone Allows the use of ``zoneinfo`` timezones with pandas. - 2022a(for system tzdata) **Note**: You only need to install the pypi package if your - system does not already provide the IANA tz database. - However, the minimum tzdata version still applies, even if it - is not enforced through an error. - - If you would like to keep your system tzdata version updated, - it is recommended to use the ``tzdata`` package from - conda-forge. -========================= ========================= =============== ============================================================= - Visualization ^^^^^^^^^^^^^ diff --git a/doc/source/whatsnew/v2.0.0.rst b/doc/source/whatsnew/v2.0.0.rst index 3afa7ee7c3f03..33367d031cd22 100644 --- a/doc/source/whatsnew/v2.0.0.rst +++ b/doc/source/whatsnew/v2.0.0.rst @@ -25,7 +25,7 @@ When installing pandas using pip, sets of optional dependencies can also be inst pip install "pandas[performance, aws]>=2.0.0" The available extras, found in the :ref:`installation guide`, are -``[all, performance, computation, timezone, fss, aws, gcp, excel, parquet, feather, hdf5, spss, postgresql, mysql, +``[all, performance, computation, fss, aws, gcp, excel, parquet, feather, hdf5, spss, postgresql, mysql, sql-other, html, xml, plot, output_formatting, clipboard, compression, test]`` (:issue:`39164`). .. _whatsnew_200.enhancements.index_can_hold_numpy_numeric_dtypes: @@ -653,6 +653,8 @@ If installed, we now require: +-------------------+-----------------+----------+---------+ | python-dateutil | 2.8.2 | X | X | +-------------------+-----------------+----------+---------+ +| tzdata | 2022.1 | X | X | ++-------------------+-----------------+----------+---------+ For `optional libraries `_ the general recommendation is to use the latest version. The following table lists the lowest version per library that is currently being tested throughout the development of pandas. diff --git a/environment.yml b/environment.yml index 7aa94dc464be1..f108b429102ea 100644 --- a/environment.yml +++ b/environment.yml @@ -52,7 +52,6 @@ dependencies: - scipy - sqlalchemy - tabulate - - tzdata>=2022a - xarray - xlrd - xlsxwriter @@ -116,3 +115,4 @@ dependencies: - pip: - sphinx-toggleprompt + - tzdata>=2022.1 diff --git a/pyproject.toml b/pyproject.toml index 0c750d60fbb67..fd974e88fae08 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,8 @@ dependencies = [ "numpy>=1.21.0; python_version>='3.10'", "numpy>=1.23.2; python_version>='3.11'", "python-dateutil>=2.8.2", - "pytz>=2020.1" + "pytz>=2020.1", + "tzdata>=2022.1" ] classifiers = [ 'Development Status :: 5 - Production/Stable', @@ -57,7 +58,6 @@ matplotlib = "pandas:plotting._matplotlib" [project.optional-dependencies] test = ['hypothesis>=6.34.2', 'pytest>=7.0.0', 'pytest-xdist>=2.2.0', 'pytest-asyncio>=0.17.0'] performance = ['bottleneck>=1.3.2', 'numba>=0.53.1', 'numexpr>=2.7.1'] -timezone = ['tzdata>=2022.1'] computation = ['scipy>=1.7.1', 'xarray>=0.21.0'] fss = ['fsspec>=2021.07.0'] aws = ['s3fs>=2021.08.0'] @@ -112,7 +112,6 @@ all = ['beautifulsoup4>=4.9.3', 'SQLAlchemy>=1.4.16', 'tables>=3.6.1', 'tabulate>=0.8.9', - 'tzdata>=2022.1', 'xarray>=0.21.0', 'xlrd>=2.0.1', 'xlsxwriter>=1.4.3', diff --git a/requirements-dev.txt b/requirements-dev.txt index 7c7f437625407..1ad6c218fcdfb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -41,7 +41,6 @@ s3fs>=2021.08.0 scipy sqlalchemy tabulate -tzdata>=2022.1 xarray xlrd xlsxwriter @@ -85,4 +84,5 @@ feedparser pyyaml requests sphinx-toggleprompt +tzdata>=2022.1 setuptools>=61.0.0 diff --git a/scripts/validate_min_versions_in_sync.py b/scripts/validate_min_versions_in_sync.py index 7c102096c1690..6fadc567747f3 100755 --- a/scripts/validate_min_versions_in_sync.py +++ b/scripts/validate_min_versions_in_sync.py @@ -74,10 +74,9 @@ def get_versions_from_ci(content: list[str]) -> tuple[dict[str, str], dict[str, continue elif seen_required and line.strip(): if "==" in line: - package, version = line.strip().split("==") - + package, version = line.strip().split("==", maxsplit=1) else: - package, version = line.strip().split("=") + package, version = line.strip().split("=", maxsplit=1) package = package[2:] if package in EXCLUDE_DEPS: continue