Skip to content

Commit 1fa78b5

Browse files
committed
scalar-return
1 parent 087a648 commit 1fa78b5

File tree

10 files changed

+13
-13
lines changed

10 files changed

+13
-13
lines changed

pandas/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
334334
return pieces
335335

336336

337-
def plus_or_dot(pieces):
337+
def plus_or_dot(pieces) -> str:
338338
"""Return a + if we don't already have one, else return a ."""
339339
if "+" in pieces.get("closest-tag", ""):
340340
return "."

pandas/core/computation/expressions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def _evaluate_standard(op, op_str, a, b):
7171
return op(a, b)
7272

7373

74-
def _can_use_numexpr(op, op_str, a, b, dtype_check):
74+
def _can_use_numexpr(op, op_str, a, b, dtype_check) -> bool:
7575
"""return a boolean if we WILL be using numexpr"""
7676
if op_str is not None:
7777

@@ -205,7 +205,7 @@ def _has_bool_dtype(x):
205205
_BOOL_OP_UNSUPPORTED = {"+": "|", "*": "&", "-": "^"}
206206

207207

208-
def _bool_arith_fallback(op_str, a, b):
208+
def _bool_arith_fallback(op_str, a, b) -> bool:
209209
"""
210210
Check if we should fallback to the python `_evaluate_standard` in case
211211
of an unsupported operation by numexpr, which is the case for some

pandas/core/dtypes/dtypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ def na_value(self) -> NaTType:
676676
return NaT
677677

678678
@cache_readonly
679-
def str(self):
679+
def str(self) -> str:
680680
return f"|M8[{self._unit}]"
681681

682682
def __init__(self, unit: str_type | DatetimeTZDtype = "ns", tz=None) -> None:

pandas/core/series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ def _maybe_update_cacher(
13281328
# Unsorted
13291329

13301330
@property
1331-
def _is_mixed_type(self):
1331+
def _is_mixed_type(self) -> bool:
13321332
return False
13331333

13341334
def repeat(self, repeats: int | Sequence[int], axis: None = None) -> Series:

pandas/io/formats/latex.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def pad_empties(x):
180180
return strcols
181181

182182
@property
183-
def _empty_info_line(self):
183+
def _empty_info_line(self) -> str:
184184
return (
185185
f"Empty {type(self.frame).__name__}\n"
186186
f"Columns: {self.frame.columns}\n"
@@ -773,7 +773,7 @@ def _get_column_format_based_on_dtypes(self) -> str:
773773
Right alignment for numbers and left - for strings.
774774
"""
775775

776-
def get_col_type(dtype):
776+
def get_col_type(dtype) -> str:
777777
if issubclass(dtype.type, np.number):
778778
return "r"
779779
return "l"

pandas/io/formats/style_render.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ def _check_trim(
627627
element,
628628
css=None,
629629
value="...",
630-
):
630+
) -> bool:
631631
"""
632632
Indicates whether to break render loops and append a trimming indicator
633633

pandas/io/sql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1856,7 +1856,7 @@ def __init__(self, *args, **kwargs) -> None:
18561856

18571857
# this will transform time(12,34,56,789) into '12:34:56.000789'
18581858
# (this is what sqlalchemy does)
1859-
def _adapt_time(t):
1859+
def _adapt_time(t) -> str:
18601860
# This is faster than strftime
18611861
return f"{t.hour:02d}:{t.minute:02d}:{t.second:02d}.{t.microsecond:06d}"
18621862

pandas/plotting/_matplotlib/boxplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def _post_plot_logic(self, ax, data) -> None:
215215
ax.set_ylabel(pprint_thing(self.ylabel))
216216

217217
@property
218-
def orientation(self):
218+
def orientation(self) -> str:
219219
if self.kwds.get("vert", True):
220220
return "vertical"
221221
else:

pandas/util/_decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def wrapper(*args, **kwargs) -> Callable[..., Any]:
215215
return _deprecate_kwarg
216216

217217

218-
def _format_argument_list(allow_args: list[str]):
218+
def _format_argument_list(allow_args: list[str]) -> str:
219219
"""
220220
Convert the allow_args argument (either string or integer) of
221221
`deprecate_nonkeyword_arguments` function to a string describing

pandas/util/_test_decorators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ def safe_import(mod_name: str, min_version: str | None = None):
111111
return False
112112

113113

114-
def _skip_if_no_mpl():
114+
def _skip_if_no_mpl() -> bool:
115115
mod = safe_import("matplotlib")
116116
if mod:
117117
mod.use("Agg")
118118
else:
119119
return True
120120

121121

122-
def _skip_if_not_us_locale():
122+
def _skip_if_not_us_locale() -> bool:
123123
lang, _ = locale.getlocale()
124124
if lang != "en_US":
125125
return True

0 commit comments

Comments
 (0)