@@ -757,10 +757,10 @@ def test_array_reshaped(self, shape):
757
757
def test_array_list (self ):
758
758
arr_list = [
759
759
"a" ,
760
- list () ,
761
- dict () ,
762
- dict () ,
763
- list () ,
760
+ [] ,
761
+ {} ,
762
+ {} ,
763
+ [] ,
764
764
42 ,
765
765
97.8 ,
766
766
["a" , "b" ],
@@ -797,9 +797,9 @@ def test_0d_array(self):
797
797
([42 , {}, "a" ], TypeError , {}),
798
798
([42 , ["a" ], 42 ], ValueError , {}),
799
799
(["a" , "b" , [], "c" ], ValueError , {}),
800
- ([{"a" : "b" }], ValueError , dict ( labelled = True ) ),
801
- ({"a" : {"b" : {"c" : 42 }}}, ValueError , dict ( labelled = True ) ),
802
- ([{"a" : 42 , "b" : 23 }, {"c" : 17 }], ValueError , dict ( labelled = True ) ),
800
+ ([{"a" : "b" }], ValueError , { " labelled" : True } ),
801
+ ({"a" : {"b" : {"c" : 42 }}}, ValueError , { " labelled" : True } ),
802
+ ([{"a" : 42 , "b" : 23 }, {"c" : 17 }], ValueError , { " labelled" : True } ),
803
803
],
804
804
)
805
805
def test_array_numpy_except (self , bad_input , exc_type , kwargs ):
@@ -852,8 +852,8 @@ def test_dataframe(self, orient, numpy):
852
852
columns = ["x" , "y" , "z" ],
853
853
dtype = dtype ,
854
854
)
855
- encode_kwargs = {} if orient is None else dict ( orient = orient )
856
- decode_kwargs = {} if numpy is None else dict ( numpy = numpy )
855
+ encode_kwargs = {} if orient is None else { " orient" : orient }
856
+ decode_kwargs = {} if numpy is None else { " numpy" : numpy }
857
857
assert (df .dtypes == dtype ).all ()
858
858
859
859
output = ujson .decode (ujson .encode (df , ** encode_kwargs ), ** decode_kwargs )
@@ -884,7 +884,7 @@ def test_dataframe_nested(self, orient):
884
884
)
885
885
886
886
nested = {"df1" : df , "df2" : df .copy ()}
887
- kwargs = {} if orient is None else dict ( orient = orient )
887
+ kwargs = {} if orient is None else { " orient" : orient }
888
888
889
889
exp = {
890
890
"df1" : ujson .decode (ujson .encode (df , ** kwargs )),
@@ -902,7 +902,7 @@ def test_dataframe_numpy_labelled(self, orient):
902
902
columns = ["x" , "y" , "z" ],
903
903
dtype = int ,
904
904
)
905
- kwargs = {} if orient is None else dict ( orient = orient )
905
+ kwargs = {} if orient is None else { " orient" : orient }
906
906
907
907
output = DataFrame (
908
908
* ujson .decode (ujson .encode (df , ** kwargs ), numpy = True , labelled = True )
@@ -925,8 +925,8 @@ def test_series(self, orient, numpy):
925
925
).sort_values ()
926
926
assert s .dtype == dtype
927
927
928
- encode_kwargs = {} if orient is None else dict ( orient = orient )
929
- decode_kwargs = {} if numpy is None else dict ( numpy = numpy )
928
+ encode_kwargs = {} if orient is None else { " orient" : orient }
929
+ decode_kwargs = {} if numpy is None else { " numpy" : numpy }
930
930
931
931
output = ujson .decode (ujson .encode (s , ** encode_kwargs ), ** decode_kwargs )
932
932
assert s .dtype == dtype
@@ -953,7 +953,7 @@ def test_series_nested(self, orient):
953
953
[10 , 20 , 30 , 40 , 50 , 60 ], name = "series" , index = [6 , 7 , 8 , 9 , 10 , 15 ]
954
954
).sort_values ()
955
955
nested = {"s1" : s , "s2" : s .copy ()}
956
- kwargs = {} if orient is None else dict ( orient = orient )
956
+ kwargs = {} if orient is None else { " orient" : orient }
957
957
958
958
exp = {
959
959
"s1" : ujson .decode (ujson .encode (s , ** kwargs )),
0 commit comments