@@ -194,7 +194,7 @@ class NDFrame(PandasObject, SelectionMixin):
194
194
# TODO(PY36): replace with _attrs : Dict[Hashable, Any]
195
195
# We need the TYPE_CHECKING, because _attrs is not a class attribute
196
196
# and Py35 doesn't support the new syntax.
197
- _attrs = {} # type: Dict[Hashable, Any]
197
+ _attrs = {} # type: Dict[Optional[ Hashable] , Any]
198
198
199
199
# ----------------------------------------------------------------------
200
200
# Constructors
@@ -205,7 +205,7 @@ def __init__(
205
205
axes : Optional [List [Index ]] = None ,
206
206
copy : bool = False ,
207
207
dtype : Optional [Dtype ] = None ,
208
- attrs : Optional [Mapping [Hashable , Any ]] = None ,
208
+ attrs : Optional [Mapping [Optional [ Hashable ] , Any ]] = None ,
209
209
fastpath : bool = False ,
210
210
):
211
211
@@ -248,7 +248,7 @@ def _init_mgr(self, mgr, axes=None, dtype=None, copy=False):
248
248
# ----------------------------------------------------------------------
249
249
250
250
@property
251
- def attrs (self ) -> Dict [Hashable , Any ]:
251
+ def attrs (self ) -> Dict [Optional [ Hashable ] , Any ]:
252
252
"""
253
253
Dictionary of global attributes on this object.
254
254
"""
@@ -257,7 +257,7 @@ def attrs(self) -> Dict[Hashable, Any]:
257
257
return self ._attrs
258
258
259
259
@attrs .setter
260
- def attrs (self , value : Mapping [Hashable , Any ]) -> None :
260
+ def attrs (self , value : Mapping [Optional [ Hashable ] , Any ]) -> None :
261
261
self ._attrs = dict (value )
262
262
263
263
@property
@@ -3149,10 +3149,10 @@ def to_csv(
3149
3149
sep : str = "," ,
3150
3150
na_rep : str = "" ,
3151
3151
float_format : Optional [str ] = None ,
3152
- columns : Optional [Sequence [Hashable ]] = None ,
3152
+ columns : Optional [Sequence [Optional [ Hashable ] ]] = None ,
3153
3153
header : Union [bool_t , List [str ]] = True ,
3154
3154
index : bool_t = True ,
3155
- index_label : Optional [Union [bool_t , str , Sequence [Hashable ]]] = None ,
3155
+ index_label : Optional [Union [bool_t , str , Sequence [Optional [ Hashable ] ]]] = None ,
3156
3156
mode : str = "w" ,
3157
3157
encoding : Optional [str ] = None ,
3158
3158
compression : Optional [Union [str , Mapping [str , str ]]] = "infer" ,
0 commit comments