Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/deps/actions-311-minimum_versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies:
- pyreadstat=1.2.8
- pytables=3.10.1
- python-calamine=0.3.0
- pytz=2024.2
- pytz=2020.1
- pyxlsb=1.0.10
- s3fs=2024.10.0
- scipy=1.14.1
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-311.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies:
- pyreadstat>=1.2.8
- pytables>=3.10.1
- python-calamine>=0.3.0
- pytz>=2024.2
- pytz>=2020.1
- pyxlsb>=1.0.10
- s3fs>=2024.10.0
- scipy>=1.14.1
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-312.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies:
- pyreadstat>=1.2.8
- pytables>=3.10.1
- python-calamine>=0.3.0
- pytz>=2024.2
- pytz>=2020.1
- pyxlsb>=1.0.10
- s3fs>=2024.10.0
- scipy>=1.14.1
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-313-downstream_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies:
- pyreadstat>=1.2.8
- pytables>=3.10.1
- python-calamine>=0.3.0
- pytz>=2024.2
- pytz>=2020.1
- pyxlsb>=1.0.10
- s3fs>=2024.10.0
- scipy>=1.14.1
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-313.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies:
- pyreadstat>=1.2.8
- pytables>=3.10.1
- python-calamine>=0.3.0
- pytz>=2024.2
- pytz>=2020.1
- pyxlsb>=1.0.10
- s3fs>=2024.10.0
- scipy>=1.14.1
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-314.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies:
- pyreadstat>=1.2.8
- pytables>=3.10.1
- python-calamine>=0.3.0
- pytz>=2024.2
- pytz>=2020.1
- pyxlsb>=1.0.10
- s3fs>=2024.10.0
- scipy>=1.14.1
Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting_started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -379,5 +379,5 @@ Installable with ``pip install "pandas[timezone]"``
========================================== ================== =================== ==============================================
Dependency Minimum Version pip extra Notes
========================================== ================== =================== ==============================================
`pytz <https://github.com/stub42/pytz>`__ 2024.2 timezone Alternative timezone library to ``zoneinfo``.
`pytz <https://github.com/stub42/pytz>`__ 2020.1 timezone Alternative timezone library to ``zoneinfo``.
========================================== ================== =================== ==============================================
2 changes: 2 additions & 0 deletions doc/source/whatsnew/v3.0.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ including other versions of pandas.
Fixed regressions
~~~~~~~~~~~~~~~~~

- Fixed reading of Parquet files with timezone-aware timestamps or localizing of a timeseries with a ``pytz`` timezone when an older version of ``pytz`` was installed (:issue:`64978`)

.. ---------------------------------------------------------------------------
.. _whatsnew_303.bug_fixes:

Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies:
- pyreadstat>=1.2.8
- pytables>=3.10.1
- python-calamine>=0.3.0
- pytz>=2024.2
- pytz>=2020.1
- pyxlsb>=1.0.10
- s3fs>=2024.10.0
- scipy>=1.14.1
Expand Down
5 changes: 4 additions & 1 deletion pandas/_libs/tslibs/timezones.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ cpdef inline tzinfo maybe_get_tz(object tz):
elif is_integer_object(tz):
tz = timezone(timedelta(seconds=tz))
elif isinstance(tz, tzinfo):
if treat_tz_as_pytz(tz) and pytz is None:
# call again for raising proper error
import_optional_dependency("pytz")
pass
elif tz is None:
pass
Expand Down Expand Up @@ -435,6 +438,6 @@ def tz_standardize(tz: tzinfo) -> tzinfo:
>>> tz_standardize(tz)
<DstTzInfo 'US/Pacific' LMT-1 day, 16:07:00 STD>
"""
if treat_tz_as_pytz(tz):
if treat_tz_as_pytz(tz) and pytz is not None:
return pytz.timezone(str(tz))
return tz
2 changes: 1 addition & 1 deletion pandas/compat/_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"pyreadstat": "1.2.8",
"pytest": "8.3.4",
"python-calamine": "0.3.0",
"pytz": "2024.2",
"pytz": "2020.1", # keep this pinned (https://github.com/pandas-dev/pandas/pull/65133)
"pyxlsb": "1.0.10",
"s3fs": "2024.10.0",
"scipy": "1.14.1",
Expand Down
2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pymysql = ">=1.1.1"
pyreadstat = ">=1.2.8"
pytables = ">=3.10.1"
python-calamine = ">=0.3.0"
pytz = ">=2024.2"
pytz = ">=2020.1"
pyxlsb = ">=1.0.10"
s3fs = ">=2024.10.0"
scipy = ">=1.14.1"
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ plot = ['matplotlib>=3.9.3']
output-formatting = ['jinja2>=3.1.5', 'tabulate>=0.9.0']
clipboard = ['PyQt5>=5.15.9', 'qtpy>=2.4.2']
compression = ['zstandard>=0.23.0']
timezone = ['pytz>=2024.2']
timezone = ['pytz>=2020.1']
all = ['adbc-driver-postgresql>=1.2.0',
'adbc-driver-sqlite>=1.2.0',
'beautifulsoup4>=4.12.3',
Expand All @@ -128,7 +128,7 @@ all = ['adbc-driver-postgresql>=1.2.0',
'pytest>=8.3.4',
'pytest-xdist>=3.6.1',
'python-calamine>=0.3.0',
'pytz>=2024.2',
'pytz>=2020.1',
'pyxlsb>=1.0.10',
'qtpy>=2.4.2',
'scipy>=1.14.1',
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pymysql>=1.1.1
pyreadstat>=1.2.8
tables>=3.10.1
python-calamine>=0.3.0
pytz>=2024.2
pytz>=2020.1
pyxlsb>=1.0.10
s3fs>=2024.10.0
scipy>=1.14.1
Expand Down
Loading