@@ -1431,16 +1431,20 @@ def _validate_format(self, format: str, kwargs: Dict[str, Any]) -> Dict[str, Any
1431
1431
return kwargs
1432
1432
1433
1433
def _create_storer (
1434
- self , group , format = None , value = None , ** kwargs
1434
+ self ,
1435
+ group ,
1436
+ format = None ,
1437
+ value = None ,
1438
+ encoding : str = "UTF-8" ,
1439
+ errors : str = "strict" ,
1435
1440
) -> Union ["GenericFixed" , "Table" ]:
1436
1441
""" return a suitable class to operate """
1437
1442
1438
1443
def error (t ):
1439
1444
# return instead of raising so mypy can tell where we are raising
1440
1445
return TypeError (
1441
1446
f"cannot properly create the storer for: [{ t } ] [group->"
1442
- f"{ group } ,value->{ type (value )} ,format->{ format } ,"
1443
- f"kwargs->{ kwargs } ]"
1447
+ f"{ group } ,value->{ type (value )} ,format->{ format } "
1444
1448
)
1445
1449
1446
1450
pt = _ensure_decoded (getattr (group ._v_attrs , "pandas_type" , None ))
@@ -1476,7 +1480,9 @@ def error(t):
1476
1480
# a storer node
1477
1481
if "table" not in pt :
1478
1482
try :
1479
- return globals ()[_STORER_MAP [pt ]](self , group , ** kwargs )
1483
+ return globals ()[_STORER_MAP [pt ]](
1484
+ self , group , encoding = encoding , errors = errors
1485
+ )
1480
1486
except KeyError :
1481
1487
raise error ("_STORER_MAP" )
1482
1488
@@ -1517,7 +1523,9 @@ def error(t):
1517
1523
pass
1518
1524
1519
1525
try :
1520
- return globals ()[_TABLE_MAP [tt ]](self , group , ** kwargs )
1526
+ return globals ()[_TABLE_MAP [tt ]](
1527
+ self , group , encoding = encoding , errors = errors
1528
+ )
1521
1529
except KeyError :
1522
1530
raise error ("_TABLE_MAP" )
1523
1531
@@ -1526,11 +1534,20 @@ def _write_to_group(
1526
1534
key : str ,
1527
1535
value ,
1528
1536
format ,
1537
+ axes = None ,
1529
1538
index = True ,
1530
1539
append = False ,
1531
1540
complib = None ,
1541
+ complevel : Optional [int ] = None ,
1542
+ fletcher32 = None ,
1543
+ min_itemsize = None ,
1544
+ chunksize = None ,
1545
+ expectedrows = None ,
1546
+ dropna = False ,
1547
+ nan_rep = None ,
1548
+ data_columns = None ,
1532
1549
encoding = None ,
1533
- ** kwargs ,
1550
+ errors : str = "strict" ,
1534
1551
):
1535
1552
group = self .get_node (key )
1536
1553
@@ -1565,7 +1582,7 @@ def _write_to_group(
1565
1582
group = self ._handle .create_group (path , p )
1566
1583
path = new_path
1567
1584
1568
- s = self ._create_storer (group , format , value , encoding = encoding , ** kwargs )
1585
+ s = self ._create_storer (group , format , value , encoding = encoding , errors = errors )
1569
1586
if append :
1570
1587
# raise if we are trying to append to a Fixed format,
1571
1588
# or a table that exists (and we are putting)
@@ -1580,7 +1597,20 @@ def _write_to_group(
1580
1597
raise ValueError ("Compression not supported on Fixed format stores" )
1581
1598
1582
1599
# write the object
1583
- s .write (obj = value , append = append , complib = complib , ** kwargs )
1600
+ s .write (
1601
+ obj = value ,
1602
+ axes = axes ,
1603
+ append = append ,
1604
+ complib = complib ,
1605
+ complevel = complevel ,
1606
+ fletcher32 = fletcher32 ,
1607
+ min_itemsize = min_itemsize ,
1608
+ chunksize = chunksize ,
1609
+ expectedrows = expectedrows ,
1610
+ dropna = dropna ,
1611
+ nan_rep = nan_rep ,
1612
+ data_columns = data_columns ,
1613
+ )
1584
1614
1585
1615
if isinstance (s , Table ) and index :
1586
1616
s .create_index (columns = index )
@@ -2524,10 +2554,11 @@ class Fixed:
2524
2554
ndim : int
2525
2555
parent : HDFStore
2526
2556
group : "Node"
2557
+ errors : str
2527
2558
is_table = False
2528
2559
2529
2560
def __init__ (
2530
- self , parent : HDFStore , group : "Node" , encoding = None , errors = "strict" , ** kwargs
2561
+ self , parent : HDFStore , group : "Node" , encoding = None , errors : str = "strict"
2531
2562
):
2532
2563
assert isinstance (parent , HDFStore ), type (parent )
2533
2564
assert _table_mod is not None # needed for mypy
@@ -3199,8 +3230,10 @@ class Table(Fixed):
3199
3230
metadata : List
3200
3231
info : Dict
3201
3232
3202
- def __init__ (self , parent : HDFStore , group : "Node" , ** kwargs ):
3203
- super ().__init__ (parent , group , ** kwargs )
3233
+ def __init__ (
3234
+ self , parent : HDFStore , group : "Node" , encoding = None , errors : str = "strict"
3235
+ ):
3236
+ super ().__init__ (parent , group , encoding = encoding , errors = errors )
3204
3237
self .index_axes = []
3205
3238
self .non_index_axes = []
3206
3239
self .values_axes = []
@@ -4076,7 +4109,6 @@ def write(
4076
4109
dropna = False ,
4077
4110
nan_rep = None ,
4078
4111
data_columns = None ,
4079
- errors = "strict" , # not used here, but passed to super
4080
4112
):
4081
4113
4082
4114
if not append and self .is_exists :
0 commit comments