Skip to content

Commit 56fd651

Browse files
author
MomIsBestFriend
committed
Added @WillAyd typing suggestions
1 parent 6f4865a commit 56fd651

File tree

2 files changed

+7
-20
lines changed

2 files changed

+7
-20
lines changed

Diff for: pandas/io/formats/css.py

+1-13
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,13 @@ class CSSWarning(UserWarning):
1515

1616

1717
def _side_expander(prop_fmt: str):
18-
"""
19-
Parameters
20-
----------
21-
prop_fmt : str
22-
"""
23-
2418
def expand(self, prop, value: str):
25-
"""
26-
Parameters
27-
----------
28-
prop
29-
value : str
30-
"""
3119
tokens = value.split()
3220
try:
3321
mapping = self.SIDE_SHORTHANDS[len(tokens)]
3422
except KeyError:
3523
warnings.warn(
36-
f"Could not expand {prop}: {value}", CSSWarning,
24+
f'Could not expand "{prop}: {value}"', CSSWarning,
3725
)
3826
return
3927
for key, idx in zip(self.SIDES, mapping):

Diff for: pandas/io/formats/csvs.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
import csv as csvlib
66
from io import StringIO
77
import os
8-
from typing import List, Optional, Sequence, Union
8+
from typing import Hashable, List, Optional, Sequence, Union
99
import warnings
1010
from zipfile import ZipFile
1111

1212
import numpy as np
1313

1414
from pandas._libs import writers as libwriters
15+
from pandas._typing import FilePathOrBuffer
1516

1617
from pandas.core.dtypes.generic import (
1718
ABCDatetimeIndex,
@@ -21,8 +22,6 @@
2122
)
2223
from pandas.core.dtypes.missing import notna
2324

24-
from pandas._typing import FilePathOrBuffer
25-
2625
from pandas.io.common import (
2726
get_compression_method,
2827
get_filepath_or_buffer,
@@ -38,11 +37,11 @@ def __init__(
3837
path_or_buf: Optional[FilePathOrBuffer[str]] = None,
3938
sep: str = ",",
4039
na_rep: str = "",
41-
float_format=None,
40+
float_format: Optional[str] = None,
4241
cols=None,
43-
header: Union[bool, Sequence[str]] = True,
42+
header: Union[bool, Sequence[Hashable]] = True,
4443
index: bool = True,
45-
index_label=None,
44+
index_label: Optional[Union[bool, Hashable, Sequence[Hashable]]] = None,
4645
mode: str = "w",
4746
encoding: Optional[str] = None,
4847
compression="infer",
@@ -52,7 +51,7 @@ def __init__(
5251
quotechar: Optional[str] = '"',
5352
date_format: Optional[str] = None,
5453
doublequote: bool = True,
55-
escapechar=None,
54+
escapechar: Optional[str] = None,
5655
decimal: Optional[str] = ".",
5756
):
5857
self.obj = obj

0 commit comments

Comments
 (0)