Skip to content

Hypothesis version 6.162.0

Choose a tag to compare

@Zac-HD Zac-HD released this 28 Jul 06:50

This release adds support for generating timezone-aware datetimes in
hypothesis.extra.pandas. You can now pass a "DatetimeTZDtype" - such
as ""datetime64[ns, UTC]"" - as the "dtype" of a "series()",
"indexes()", or "column()", and every value will share that single
timezone. The datetime resolution is taken from the dtype, so you can
also generate e.g. ""datetime64[us, UTC]"" columns, and for UTC and
other fixed-offset timezones the generated values cover the full range
representable at that resolution - which for coarser units is far
wider than the "datetime64[ns]" bounds of roughly 1677-2262 (issue
#4020).

Timezone-aware generation requires pandas >= 2.1. Generated values
include "NaT" unless you pass an elements strategy which excludes it.

The canonical version of these notes (with links) is on readthedocs.