Skip to content

Commit 2716dd5

Browse files
GH730 PR feedback
1 parent 9ac31af commit 2716dd5

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

pandas-stubs/core/frame.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -2314,7 +2314,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
23142314
index: _bool = ...,
23152315
na_rep: _str = ...,
23162316
formatters: FormattersType | None = ...,
2317-
float_format: FloatFormatType | Callable[[float], str] | None = ...,
2317+
float_format: FloatFormatType | None = ...,
23182318
sparsify: _bool | None = ...,
23192319
index_names: _bool = ...,
23202320
justify: _str | None = ...,
@@ -2337,7 +2337,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
23372337
index: _bool = ...,
23382338
na_rep: _str = ...,
23392339
formatters: FormattersType | None = ...,
2340-
float_format: FloatFormatType | Callable[[float], str] | None = ...,
2340+
float_format: FloatFormatType | None = ...,
23412341
sparsify: _bool | None = ...,
23422342
index_names: _bool = ...,
23432343
justify: _str | None = ...,

pandas-stubs/core/series.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
531531
self,
532532
buf: FilePath | WriteBuffer[str],
533533
na_rep: _str = ...,
534-
float_format: FloatFormatType | Callable[[float], str] = ...,
534+
float_format: FloatFormatType = ...,
535535
header: _bool = ...,
536536
index: _bool = ...,
537537
length: _bool = ...,
@@ -545,7 +545,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
545545
self,
546546
buf: None = ...,
547547
na_rep: _str = ...,
548-
float_format: FloatFormatType | Callable[[float], str] = ...,
548+
float_format: FloatFormatType = ...,
549549
header: _bool = ...,
550550
index: _bool = ...,
551551
length: _bool = ...,

tests/test_frame.py

-1
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,6 @@ def test_dataframe_to_string_float_fmt() -> None:
17091709
def _formatter(x) -> str:
17101710
return f"{x:.2f}"
17111711

1712-
check(assert_type(df.to_string(), str), str)
17131712
check(assert_type(df.to_string(float_format=_formatter), str), str)
17141713
check(
17151714
assert_type(

tests/test_series.py

-2
Original file line numberDiff line numberDiff line change
@@ -2944,7 +2944,6 @@ def test_series_to_string_float_fmt() -> None:
29442944
def _formatter(x) -> str:
29452945
return f"{x:.2f}"
29462946

2947-
check(assert_type(sr.to_string(), str), str)
29482947
check(assert_type(sr.to_string(float_format=_formatter), str), str)
29492948
check(
29502949
assert_type(
@@ -2954,7 +2953,6 @@ def _formatter(x) -> str:
29542953
str,
29552954
)
29562955
check(assert_type(sr.to_string(float_format="%.2f"), str), str)
2957-
check(assert_type(sr.to_string(float_format="%.2f"), str), str)
29582956

29592957

29602958
def test_types_mask() -> None:

0 commit comments

Comments
 (0)