Skip to content

Commit ff2d9f3

Browse files
jbrockmendelclaude
andcommitted
DOC: fill in issue references
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 9ddd5d1 commit ff2d9f3

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

doc/source/whatsnew/v3.1.0.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ See :ref:`install.dependencies` and :ref:`install.optional_dependencies` for mor
118118
Other API changes
119119
^^^^^^^^^^^^^^^^^
120120
- :attr:`Index.values` and :attr:`Index.array` now return read-only arrays for all dtypes, so an :class:`Index` can no longer be silently corrupted by mutating the returned array in place (previously this left the Index displaying the new value while lookups still used the old one) (:issue:`38547`)
121-
- :class:`Timestamp` with a non-zero ``nanosecond`` argument now stores the result in nanosecond resolution regardless of ``unit`` and of the input's own resolution, so values too far from the epoch to be held in nanoseconds raise :class:`OutOfBoundsDatetime` where the keyword was previously ignored (:issue:`XXXXX`)
121+
- :class:`Timestamp` with a non-zero ``nanosecond`` argument now stores the result in nanosecond resolution regardless of ``unit`` and of the input's own resolution, so values too far from the epoch to be held in nanoseconds raise :class:`OutOfBoundsDatetime` where the keyword was previously ignored (:issue:`66533`)
122122
- :func:`infer_freq` on quarter-start data now reports the equivalent anchor from the first calendar quarter, e.g. ``QS-JAN`` instead of ``QS-OCT`` (:issue:`36939`)
123123
- :func:`testing.assert_frame_equal` with ``check_freq=True`` now also checks the ``freq`` of :class:`DatetimeIndex` and :class:`TimedeltaIndex` *columns*; previously only the ``freq`` of the index was checked (:issue:`51920`)
124124
- :func:`testing.assert_series_equal` with ``check_index=False`` no longer checks the ``freq`` attribute of a :class:`DatetimeIndex` or :class:`TimedeltaIndex`, as ``freq`` is an attribute of the index (:issue:`51920`)
@@ -338,8 +338,8 @@ Datetimelike
338338
- Bug in :class:`Timestamp` constructor and :meth:`Timestamp.replace` where a value landing exactly on the ``NaT`` sentinel — whether from a ``nanosecond`` or ``microsecond`` argument or from shifting a timezone-aware wall time to UTC — silently produced ``NaT`` (or a :class:`Timestamp` that reported itself as non-null but read back as ``NaT`` once placed in a :class:`Series`) instead of raising :class:`OutOfBoundsDatetime` (:issue:`66510`)
339339
- Bug in :class:`Timestamp` constructor and :meth:`Timestamp.replace` where shifting a timezone-aware value to UTC past the representable range raised a raw ``OverflowError`` instead of :class:`OutOfBoundsDatetime`, e.g. ``Timestamp.max.replace(tzinfo=timezone(timedelta(hours=-9)))`` (:issue:`66510`)
340340
- Bug in :class:`Timestamp` constructor where passing ``np.str_`` objects would fail in Cython string parsing (:issue:`48974`)
341-
- Bug in :class:`Timestamp` constructor where the ``nanosecond`` keyword was silently ignored unless the first argument was a ``datetime`` or :class:`Timestamp`; it is now also honored for :class:`numpy.datetime64`, ``date``, ``int``, and ``float`` input, in each case overwriting (not adding to) the sub-microsecond portion of the input (:issue:`XXXXX`)
342341
- Bug in :class:`Timestamp` constructor where strings with a negative year of fewer than 4 digits (e.g. ``"-111-01-01"``) silently dropped the leading ``"-"`` and were parsed as a positive year; BC dates with 1-4 digit years now parse correctly, matching :class:`numpy.datetime64` (:issue:`55954`)
342+
- Bug in :class:`Timestamp` constructor where the ``nanosecond`` keyword was silently ignored unless the first argument was a ``datetime`` or :class:`Timestamp`; it is now also honored for :class:`numpy.datetime64`, ``date``, ``int``, and ``float`` input, in each case overwriting (not adding to) the sub-microsecond portion of the input (:issue:`66533`)
343343
- Bug in :class:`Timestamp` constructor, :class:`Timedelta` constructor, :func:`to_datetime`, and :func:`to_timedelta` with non-round ``float`` input and ``unit`` failing to raise when the value is just outside the representable bounds (:issue:`57366`)
344344
- Bug in :func:`api.types.infer_dtype` returning ``"date"`` or ``"mixed"`` instead of ``"datetime"`` / ``"timedelta"`` for lists of :class:`Timestamp`/:class:`Timedelta` values mixed with ``pd.NA`` (:issue:`53023`)
345345
- Bug in :func:`date_range` where ``inclusive="left"`` and ``inclusive="right"`` returned a single-element result instead of empty when ``start`` equals ``end`` (:issue:`55293`)

pandas/tests/scalar/timestamp/test_constructors.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ def test_timestamp_iso8601_offset_out_of_bounds(tz):
12061206
],
12071207
)
12081208
def test_timestamp_constructor_nanosecond_kwarg(ts_input, kwargs):
1209-
# GH#XXXXX nanosecond was silently dropped for everything but pydatetime.
1209+
# GH#66533 nanosecond was silently dropped for everything but pydatetime.
12101210
# The inputs carrying 123ns also pin down "set", not "add", semantics.
12111211
result = Timestamp(ts_input, nanosecond=5, **kwargs)
12121212
assert result.nanosecond == 5
@@ -1215,7 +1215,7 @@ def test_timestamp_constructor_nanosecond_kwarg(ts_input, kwargs):
12151215

12161216

12171217
def test_timestamp_constructor_nanosecond_kwarg_float():
1218-
# GH#XXXXX non-integral float input; the 456ns pins down set-not-add, and
1218+
# GH#66533 non-integral float input; the 456ns pins down set-not-add, and
12191219
# the microseconds must survive the overwrite
12201220
result = Timestamp(0.000123456, unit="s", nanosecond=5)
12211221
assert result == Timestamp("1970-01-01 00:00:00.000123") + Timedelta(nanoseconds=5)
@@ -1231,7 +1231,7 @@ def test_timestamp_constructor_nanosecond_kwarg_float():
12311231
],
12321232
)
12331233
def test_timestamp_constructor_nanosecond_kwarg_pre_epoch(ts_input, kwargs):
1234-
# GH#XXXXX -1ns has 999 in the sub-microsecond field, so adding rather
1234+
# GH#66533 -1ns has 999 in the sub-microsecond field, so adding rather
12351235
# than setting would carry into the microseconds
12361236
result = Timestamp(ts_input, nanosecond=5, **kwargs)
12371237
assert result == Timestamp("1969-12-31 23:59:59.999999") + Timedelta(nanoseconds=5)
@@ -1247,7 +1247,7 @@ def test_timestamp_constructor_nanosecond_kwarg_pre_epoch(ts_input, kwargs):
12471247
],
12481248
)
12491249
def test_timestamp_constructor_nanosecond_kwarg_preserves_microsecond(ts_input):
1250-
# GH#XXXXX only the sub-microsecond field is overwritten
1250+
# GH#66533 only the sub-microsecond field is overwritten
12511251
result = Timestamp(ts_input, nanosecond=5)
12521252
assert result.microsecond == 123
12531253
assert result.nanosecond == 5
@@ -1262,7 +1262,7 @@ def test_timestamp_constructor_nanosecond_kwarg_preserves_microsecond(ts_input):
12621262
],
12631263
)
12641264
def test_timestamp_constructor_nanosecond_zero_not_passed(ts_input, kwargs):
1265-
# GH#XXXXX nanosecond=0 means "not passed", so the input's own
1265+
# GH#66533 nanosecond=0 means "not passed", so the input's own
12661266
# resolution is retained
12671267
result = Timestamp(ts_input, nanosecond=0, **kwargs)
12681268
assert result.unit == "s"
@@ -1277,15 +1277,15 @@ def test_timestamp_constructor_nanosecond_zero_not_passed(ts_input, kwargs):
12771277
],
12781278
)
12791279
def test_timestamp_constructor_nanosecond_zero_keeps_sub_microsecond(ts_input):
1280-
# GH#XXXXX "not passed" is the *only* meaning of nanosecond=0 -- it does not
1280+
# GH#66533 "not passed" is the *only* meaning of nanosecond=0 -- it does not
12811281
# zero an existing sub-microsecond value, matching the long-standing
12821282
# pydatetime behaviour. A non-zero nanosecond does overwrite.
12831283
assert Timestamp(ts_input).nanosecond == 123
12841284
assert Timestamp(ts_input, nanosecond=0).nanosecond == 123
12851285

12861286

12871287
def test_timestamp_constructor_nanosecond_kwarg_tz_epoch_int():
1288-
# GH#XXXXX an epoch integer is UTC-based, so tz converts rather than
1288+
# GH#66533 an epoch integer is UTC-based, so tz converts rather than
12891289
# localizes
12901290
result = Timestamp(0, unit="s", nanosecond=5, tz="US/Pacific")
12911291
assert result._value == 5
@@ -1302,7 +1302,7 @@ def test_timestamp_constructor_nanosecond_kwarg_tz_epoch_int():
13021302
],
13031303
)
13041304
def test_timestamp_constructor_nanosecond_kwarg_tz_wall(ts_input):
1305-
# GH#XXXXX datetime64/date/datetime are wall times, so tz localizes
1305+
# GH#66533 datetime64/date/datetime are wall times, so tz localizes
13061306
result = Timestamp(ts_input, nanosecond=5, tz="US/Pacific")
13071307
assert result._value == 8 * 3600 * 10**9 + 5
13081308
assert result.nanosecond == 5
@@ -1339,7 +1339,7 @@ def test_timestamp_constructor_nanosecond_kwarg_tz_wall(ts_input):
13391339
def test_timestamp_constructor_nanosecond_kwarg_out_of_bounds(
13401340
ts_input, kwargs, nanosecond, msg
13411341
):
1342-
# GH#XXXXX
1342+
# GH#66533
13431343
with pytest.raises(OutOfBoundsDatetime, match=msg):
13441344
Timestamp(ts_input, nanosecond=nanosecond, **kwargs)
13451345

0 commit comments

Comments
 (0)