Skip to content

Commit 08b2c46

Browse files
authored
Merge branch 'main' into remove-doc-decorators
2 parents ad81150 + 809d9b7 commit 08b2c46

File tree

163 files changed

+841
-492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+841
-492
lines changed

doc/source/whatsnew/v3.0.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,7 @@ Other API changes
748748
the dtype of the resulting Index (:issue:`60797`)
749749
- :class:`IncompatibleFrequency` now subclasses ``TypeError`` instead of ``ValueError``. As a result, joins with mismatched frequencies now cast to object like other non-comparable joins, and arithmetic with indexes with mismatched frequencies align (:issue:`55782`)
750750
- :class:`Series` "flex" methods like :meth:`Series.add` no longer allow passing a :class:`DataFrame` for ``other``; use the DataFrame reversed method instead (:issue:`46179`)
751+
- :func:`date_range` and :func:`timedelta_range` no longer default to ``unit="ns"``, instead will infer a unit from the ``start``, ``end``, and ``freq`` parameters. Explicitly specify a desired ``unit`` to override these (:issue:`59031`)
751752
- :meth:`CategoricalIndex.append` no longer attempts to cast different-dtype indexes to the caller's dtype (:issue:`41626`)
752753
- :meth:`ExtensionDtype.construct_array_type` is now a regular method instead of a ``classmethod`` (:issue:`58663`)
753754
- Arithmetic operations between a :class:`Series`, :class:`Index`, or :class:`ExtensionArray` with a ``list`` now consistently wrap that list with an array equivalent to ``Series(my_list).array``. To do any other kind of type inference or casting, do so explicitly before operating (:issue:`62552`)
@@ -1189,6 +1190,7 @@ I/O
11891190
- Fix bug in ``on_bad_lines`` callable when returning too many fields: now emits
11901191
``ParserWarning`` and truncates extra fields regardless of ``index_col`` (:issue:`61837`)
11911192
- Bug in :func:`pandas.json_normalize` inconsistently handling non-dict items in ``data`` when ``max_level`` was set. The function will now raise a ``TypeError`` if ``data`` is a list containing non-dict items (:issue:`62829`)
1193+
- Bug in :func:`pandas.json_normalize` raising ``TypeError`` when ``meta`` contained a non-string key (e.g., ``int``) and ``record_path`` was specified, which was inconsistent with the behavior when ``record_path`` was ``None`` (:issue:`63019`)
11921194
- Bug in :meth:`.DataFrame.to_json` when ``"index"`` was a value in the :attr:`DataFrame.column` and :attr:`Index.name` was ``None``. Now, this will fail with a ``ValueError`` (:issue:`58925`)
11931195
- Bug in :meth:`.io.common.is_fsspec_url` not recognizing chained fsspec URLs (:issue:`48978`)
11941196
- Bug in :meth:`DataFrame._repr_html_` which ignored the ``"display.float_format"`` option (:issue:`59876`)

pandas/_libs/hashtable_class_helper.pxi.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ cdef class StringHashTable(HashTable):
10701070
val = values[i]
10711071

10721072
if isinstance(val, str):
1073-
# GH#31499 if we have a np.str_ PyUnicode_AsUTF8 won't recognize
1073+
# GH#31499 if we have an np.str_ PyUnicode_AsUTF8 won't recognize
10741074
# it as a str, even though isinstance does.
10751075
v = PyUnicode_AsUTF8(<str>val)
10761076
else:
@@ -1108,7 +1108,7 @@ cdef class StringHashTable(HashTable):
11081108
val = values[i]
11091109

11101110
if isinstance(val, str):
1111-
# GH#31499 if we have a np.str_ PyUnicode_AsUTF8 won't recognize
1111+
# GH#31499 if we have an np.str_ PyUnicode_AsUTF8 won't recognize
11121112
# it as a str, even though isinstance does.
11131113
v = PyUnicode_AsUTF8(<str>val)
11141114
else:

pandas/_libs/index.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ cdef bint is_definitely_invalid_key(object val):
5858

5959
cdef ndarray _get_bool_indexer(ndarray values, object val, ndarray mask = None):
6060
"""
61-
Return a ndarray[bool] of locations where val matches self.values.
61+
Return an ndarray[bool] of locations where val matches self.values.
6262
6363
If val is not NA, this is equivalent to `self.values == val`
6464
"""

pandas/_libs/tslib.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def format_array_from_datetime(
120120
NPY_DATETIMEUNIT reso=NPY_FR_ns,
121121
) -> np.ndarray:
122122
"""
123-
return a np object array of the string formatted values
123+
return an np object array of the string formatted values
124124

125125
Parameters
126126
----------

pandas/_libs/tslibs/conversion.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ cdef (int64_t, int) precision_from_unit(
276276

277277
cdef int64_t get_datetime64_nanos(object val, NPY_DATETIMEUNIT reso) except? -1:
278278
"""
279-
Extract the value and unit from a np.datetime64 object, then convert the
279+
Extract the value and unit from an np.datetime64 object, then convert the
280280
value to nanoseconds if necessary.
281281
"""
282282
cdef:

pandas/_libs/tslibs/nattype.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1885,7 +1885,7 @@ cdef bint checknull_with_nat(object val):
18851885

18861886
cdef bint is_dt64nat(object val):
18871887
"""
1888-
Is this a np.datetime64 object np.datetime64("NaT").
1888+
Is this an np.datetime64 object np.datetime64("NaT").
18891889
"""
18901890
if cnp.is_datetime64_object(val):
18911891
return cnp.get_datetime64_value(val) == NPY_NAT
@@ -1894,7 +1894,7 @@ cdef bint is_dt64nat(object val):
18941894

18951895
cdef bint is_td64nat(object val):
18961896
"""
1897-
Is this a np.timedelta64 object np.timedelta64("NaT").
1897+
Is this an np.timedelta64 object np.timedelta64("NaT").
18981898
"""
18991899
if cnp.is_timedelta64_object(val):
19001900
return cnp.get_timedelta64_value(val) == NPY_NAT

pandas/_libs/tslibs/np_datetime.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ class OutOfBoundsTimedelta(ValueError):
208208
209209
Examples
210210
--------
211-
>>> pd.date_range(start="1/1/1700", freq="B", periods=100000)
211+
>>> pd.date_range(start="1/1/1700", freq="B", periods=100000, unit="ns")
212212
Traceback (most recent call last):
213213
OutOfBoundsTimedelta: Cannot cast 139999 days 00:00:00
214214
to unit='ns' without overflow.

pandas/_libs/tslibs/offsets.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ cdef class BaseOffset:
818818
state["normalize"] = self.normalize
819819

820820
# we don't want to actually pickle the calendar object
821-
# as its a np.busyday; we recreate on deserialization
821+
# as its an np.busyday; we recreate on deserialization
822822
state.pop("calendar", None)
823823
if "kwds" in state:
824824
state["kwds"].pop("calendar", None)

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,7 @@ cdef class _Timedelta(timedelta):
14891489
"""
14901490
cdef:
14911491
str abbrev = npy_unit_to_abbrev(self._creso)
1492-
# TODO: way to create a np.timedelta64 obj with the reso directly
1492+
# TODO: way to create an np.timedelta64 obj with the reso directly
14931493
# instead of having to get the abbrev?
14941494
return np.timedelta64(self._value, abbrev)
14951495

pandas/_libs/tslibs/timestamps.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ cdef class _Timestamp(ABCTimestamp):
412412

413413
@classmethod
414414
def _from_dt64(cls, dt64: np.datetime64):
415-
# construct a Timestamp from a np.datetime64 object, keeping the
415+
# construct a Timestamp from an np.datetime64 object, keeping the
416416
# resolution of the input.
417417
# This is here mainly so we can incrementally implement non-nano
418418
# (e.g. only tznaive at first)

0 commit comments

Comments
 (0)