Skip to content

Commit f9f92af

Browse files
committed
Merge remote-tracking branch 'upstream/main' into deps/pytz/optional
2 parents db94b7e + dcb5494 commit f9f92af

File tree

16 files changed

+127
-145
lines changed

16 files changed

+127
-145
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ci:
1919
skip: [pyright, mypy]
2020
repos:
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.4.7
22+
rev: v0.5.0
2323
hooks:
2424
- id: ruff
2525
args: [--exit-non-zero-on-fix]
@@ -73,7 +73,7 @@ repos:
7373
hooks:
7474
- id: isort
7575
- repo: https://github.com/asottile/pyupgrade
76-
rev: v3.15.2
76+
rev: v3.16.0
7777
hooks:
7878
- id: pyupgrade
7979
args: [--py310-plus]
@@ -93,7 +93,7 @@ repos:
9393
- id: sphinx-lint
9494
args: ["--enable", "all", "--disable", "line-too-long"]
9595
- repo: https://github.com/pre-commit/mirrors-clang-format
96-
rev: v18.1.5
96+
rev: v18.1.8
9797
hooks:
9898
- id: clang-format
9999
files: ^pandas/_libs/src|^pandas/_libs/include

ci/code_checks.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
249249
-i "pandas.Timestamp.resolution PR02" \
250250
-i "pandas.Timestamp.second GL08" \
251251
-i "pandas.Timestamp.strptime PR01,SA01" \
252-
-i "pandas.Timestamp.time SA01" \
253252
-i "pandas.Timestamp.timestamp SA01" \
254253
-i "pandas.Timestamp.timetuple SA01" \
255254
-i "pandas.Timestamp.timetz SA01" \

doc/source/whatsnew/v3.0.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,8 @@ I/O
596596
- Bug in :meth:`read_csv` raising ``TypeError`` when ``index_col`` is specified and ``na_values`` is a dict containing the key ``None``. (:issue:`57547`)
597597
- Bug in :meth:`read_csv` raising ``TypeError`` when ``nrows`` and ``iterator`` are specified without specifying a ``chunksize``. (:issue:`59079`)
598598
- Bug in :meth:`read_excel` raising ``ValueError`` when passing array of boolean values when ``dtype="boolean"``. (:issue:`58159`)
599+
- Bug in :meth:`read_json` not validating the ``typ`` argument to not be exactly ``"frame"`` or ``"series"`` (:issue:`59124`)
599600
- Bug in :meth:`read_stata` raising ``KeyError`` when input file is stored in big-endian format and contains strL data. (:issue:`58638`)
600-
-
601601

602602
Period
603603
^^^^^^

pandas/_libs/tslibs/nattype.pyx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,16 @@ class NaTType(_NaT):
633633
"""
634634
Return time object with same time but with tzinfo=None.
635635
636+
This method extracts the time part of the `Timestamp` object, excluding any
637+
timezone information. It returns a `datetime.time` object which only represents
638+
the time (hours, minutes, seconds, and microseconds).
639+
640+
See Also
641+
--------
642+
Timestamp.date : Return date object with same year, month and day.
643+
Timestamp.tz_convert : Convert timezone-aware Timestamp to another time zone.
644+
Timestamp.tz_localize : Localize the Timestamp to a timezone.
645+
636646
Examples
637647
--------
638648
>>> ts = pd.Timestamp('2023-01-01 10:00:00')

pandas/_libs/tslibs/timestamps.pyx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,6 +1778,16 @@ class Timestamp(_Timestamp):
17781778
"""
17791779
Return time object with same time but with tzinfo=None.
17801780
1781+
This method extracts the time part of the `Timestamp` object, excluding any
1782+
timezone information. It returns a `datetime.time` object which only represents
1783+
the time (hours, minutes, seconds, and microseconds).
1784+
1785+
See Also
1786+
--------
1787+
Timestamp.date : Return date object with same year, month and day.
1788+
Timestamp.tz_convert : Convert timezone-aware Timestamp to another time zone.
1789+
Timestamp.tz_localize : Localize the Timestamp to a timezone.
1790+
17811791
Examples
17821792
--------
17831793
>>> ts = pd.Timestamp('2023-01-01 10:00:00')

pandas/core/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def is_bool_indexer(key: Any) -> bool:
145145
elif isinstance(key, list):
146146
# check if np.array(key).dtype would be bool
147147
if len(key) > 0:
148-
if type(key) is not list: # noqa: E721
148+
if type(key) is not list:
149149
# GH#42461 cython will raise TypeError if we pass a subclass
150150
key = list(key)
151151
return lib.is_bool_list(key)

pandas/core/indexes/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7528,7 +7528,7 @@ def ensure_index(index_like: Axes, copy: bool = False) -> Index:
75287528
index_like = list(index_like)
75297529

75307530
if isinstance(index_like, list):
7531-
if type(index_like) is not list: # noqa: E721
7531+
if type(index_like) is not list:
75327532
# must check for exactly list here because of strict type
75337533
# check in clean_index_list
75347534
index_like = list(index_like)

pandas/core/internals/construction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ def _list_of_dict_to_arrays(
842842

843843
# assure that they are of the base dict class and not of derived
844844
# classes
845-
data = [d if type(d) is dict else dict(d) for d in data] # noqa: E721
845+
data = [d if type(d) is dict else dict(d) for d in data]
846846

847847
content = lib.dicts_to_array(data, list(columns))
848848
return content, columns

pandas/core/series.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6567,7 +6567,7 @@ def min(
65676567
Returns
65686568
-------
65696569
scalar or Series (if level specified)
6570-
The maximum of the values in the Series.
6570+
The minimum of the values in the Series.
65716571
65726572
See Also
65736573
--------
@@ -6716,7 +6716,7 @@ def sum(
67166716
Returns
67176717
-------
67186718
scalar or Series (if level specified)
6719-
Median of the values for the requested axis.
6719+
Sum of the values for the requested axis.
67206720
67216721
See Also
67226722
--------
@@ -6826,7 +6826,7 @@ def mean(
68266826
Returns
68276827
-------
68286828
scalar or Series (if level specified)
6829-
Median of the values for the requested axis.
6829+
Mean of the values for the requested axis.
68306830
68316831
See Also
68326832
--------

pandas/core/tools/datetimes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class FulldatetimeDict(YearMonthDayDict, total=False):
129129
def _guess_datetime_format_for_array(arr, dayfirst: bool | None = False) -> str | None:
130130
# Try to guess the format based on the first non-NaN element, return None if can't
131131
if (first_non_null := tslib.first_non_null(arr)) != -1:
132-
if type(first_non_nan_element := arr[first_non_null]) is str: # noqa: E721
132+
if type(first_non_nan_element := arr[first_non_null]) is str:
133133
# GH#32264 np.str_ object
134134
guessed_format = guess_datetime_format(
135135
first_non_nan_element, dayfirst=dayfirst

0 commit comments

Comments
 (0)