Skip to content

Commit 0876947

Browse files
committed
Merge pull request #7672 from rockg/holiday-doc
Add some documentation on gotchas related to pytz updates #7620
2 parents 0037eed + a96c1a6 commit 0876947

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

doc/source/io.rst

+9
Original file line numberDiff line numberDiff line change
@@ -2938,6 +2938,8 @@ Furthermore ``ptrepack in.h5 out.h5`` will *repack* the file to allow
29382938
you to reuse previously deleted space. Aalternatively, one can simply
29392939
remove the file and write again, or use the ``copy`` method.
29402940

2941+
.. _io.hdf5-notes:
2942+
29412943
Notes & Caveats
29422944
~~~~~~~~~~~~~~~
29432945

@@ -2960,6 +2962,13 @@ Notes & Caveats
29602962
``tables``. The sizes of a string based indexing column
29612963
(e.g. *columns* or *minor_axis*) are determined as the maximum size
29622964
of the elements in that axis or by passing the parameter
2965+
- Be aware that timezones (e.g., ``pytz.timezone('US/Eastern')``)
2966+
are not necessarily equal across timezone versions. So if data is
2967+
localized to a specific timezone in the HDFStore using one version
2968+
of a timezone library and that data is updated with another version, the data
2969+
will be converted to UTC since these timezones are not considered
2970+
equal. Either use the same version of timezone library or use ``tz_convert`` with
2971+
the updated timezone definition.
29632972

29642973
.. warning::
29652974

doc/source/timeseries.rst

+8-1
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,14 @@ tz-aware data to another time zone:
13431343

13441344
Be wary of conversions between libraries. For some zones ``pytz`` and ``dateutil`` have different
13451345
definitions of the zone. This is more of a problem for unusual timezones than for
1346-
'standard' zones like ``US/Eastern``.
1346+
'standard' zones like ``US/Eastern``.
1347+
1348+
.. warning::
1349+
1350+
Be aware that a timezone definition across versions of timezone libraries may not
1351+
be considered equal. This may cause problems when working with stored data that
1352+
is localized using one version and operated on with a different version.
1353+
See :ref:`here<io.hdf5-notes>` for how to handle such a situation.
13471354

13481355
Under the hood, all timestamps are stored in UTC. Scalar values from a
13491356
``DatetimeIndex`` with a time zone will have their fields (day, hour, minute)

0 commit comments

Comments
 (0)