@@ -48,8 +48,8 @@ def transform_assert_equal(request):
4848@pytest .mark .parametrize (
4949 "input_kwargs,result_kwargs" ,
5050 [
51- (dict (), dict ( dtype = np .int64 ) ),
52- (dict ( errors = " coerce" , downcast = " integer"), dict ( dtype = np .int8 ) ),
51+ ({}, { " dtype" : np .int64 } ),
52+ ({ " errors" : " coerce" , " downcast" : " integer"}, { " dtype" : np .int8 } ),
5353 ],
5454)
5555def test_empty (input_kwargs , result_kwargs ):
@@ -147,10 +147,10 @@ def test_list():
147147@pytest .mark .parametrize (
148148 "data,arr_kwargs" ,
149149 [
150- ([1 , 3 , 4 , 5 ], dict ( dtype = np .int64 ) ),
151- ([1.0 , 3.0 , 4.0 , 5.0 ], dict () ),
150+ ([1 , 3 , 4 , 5 ], { " dtype" : np .int64 } ),
151+ ([1.0 , 3.0 , 4.0 , 5.0 ], {} ),
152152 # Boolean is regarded as numeric.
153- ([True , False , True , True ], dict () ),
153+ ([True , False , True , True ], {} ),
154154 ],
155155)
156156def test_list_numeric (data , arr_kwargs ):
@@ -159,7 +159,7 @@ def test_list_numeric(data, arr_kwargs):
159159 tm .assert_numpy_array_equal (result , expected )
160160
161161
162- @pytest .mark .parametrize ("kwargs" , [dict ( dtype = "O" ), dict () ])
162+ @pytest .mark .parametrize ("kwargs" , [{ " dtype" : "O" }, {} ])
163163def test_numeric (kwargs ):
164164 data = [1 , - 3.14 , 7 ]
165165
@@ -182,13 +182,13 @@ def test_numeric(kwargs):
182182def test_numeric_df_columns (columns ):
183183 # see gh-14827
184184 df = DataFrame (
185- dict (
186- a = [1.2 , decimal .Decimal (3.14 ), decimal .Decimal ("infinity" ), "0.1" ],
187- b = [1.0 , 2.0 , 3.0 , 4.0 ],
188- )
185+ {
186+ "a" : [1.2 , decimal .Decimal (3.14 ), decimal .Decimal ("infinity" ), "0.1" ],
187+ "b" : [1.0 , 2.0 , 3.0 , 4.0 ],
188+ }
189189 )
190190
191- expected = DataFrame (dict ( a = [1.2 , 3.14 , np .inf , 0.1 ], b = [1.0 , 2.0 , 3.0 , 4.0 ]) )
191+ expected = DataFrame ({ "a" : [1.2 , 3.14 , np .inf , 0.1 ], "b" : [1.0 , 2.0 , 3.0 , 4.0 ]} )
192192
193193 df_copy = df .copy ()
194194 df_copy [columns ] = df_copy [columns ].apply (to_numeric )
@@ -208,10 +208,10 @@ def test_numeric_df_columns(columns):
208208)
209209def test_numeric_embedded_arr_likes (data , exp_data ):
210210 # Test to_numeric with embedded lists and arrays
211- df = DataFrame (dict ( a = data ) )
211+ df = DataFrame ({ "a" : data } )
212212 df ["a" ] = df ["a" ].apply (to_numeric )
213213
214- expected = DataFrame (dict ( a = exp_data ) )
214+ expected = DataFrame ({ "a" : exp_data } )
215215 tm .assert_frame_equal (df , expected )
216216
217217
@@ -226,7 +226,7 @@ def test_all_nan():
226226def test_type_check (errors ):
227227 # see gh-11776
228228 df = DataFrame ({"a" : [1 , - 3.14 , 7 ], "b" : ["4" , "5" , "6" ]})
229- kwargs = dict ( errors = errors ) if errors is not None else dict ()
229+ kwargs = { " errors" : errors } if errors is not None else {}
230230 error_ctx = pytest .raises (TypeError , match = "1-d array" )
231231
232232 with error_ctx :
@@ -241,7 +241,7 @@ def test_scalar(val, signed, transform):
241241
242242def test_really_large_scalar (large_val , signed , transform , errors ):
243243 # see gh-24910
244- kwargs = dict ( errors = errors ) if errors is not None else dict ()
244+ kwargs = { " errors" : errors } if errors is not None else {}
245245 val = - large_val if signed else large_val
246246
247247 val = transform (val )
@@ -258,7 +258,7 @@ def test_really_large_scalar(large_val, signed, transform, errors):
258258
259259def test_really_large_in_arr (large_val , signed , transform , multiple_elts , errors ):
260260 # see gh-24910
261- kwargs = dict ( errors = errors ) if errors is not None else dict ()
261+ kwargs = { " errors" : errors } if errors is not None else {}
262262 val = - large_val if signed else large_val
263263 val = transform (val )
264264
@@ -300,7 +300,7 @@ def test_really_large_in_arr_consistent(large_val, signed, multiple_elts, errors
300300 #
301301 # Even if we discover that we have to hold float, does not mean
302302 # we should be lenient on subsequent elements that fail to be integer.
303- kwargs = dict ( errors = errors ) if errors is not None else dict ()
303+ kwargs = { " errors" : errors } if errors is not None else {}
304304 arr = [str (- large_val if signed else large_val )]
305305
306306 if multiple_elts :
@@ -452,12 +452,12 @@ def test_errors_invalid_value():
452452 "kwargs,exp_dtype" ,
453453 [
454454 # Basic function tests.
455- (dict () , np .int64 ),
456- (dict ( downcast = None ) , np .int64 ),
455+ ({} , np .int64 ),
456+ ({ " downcast" : None } , np .int64 ),
457457 # Support below np.float32 is rare and far between.
458- (dict ( downcast = " float") , np .dtype (np .float32 ).char ),
458+ ({ " downcast" : " float"} , np .dtype (np .float32 ).char ),
459459 # Basic dtype support.
460- (dict ( downcast = " unsigned") , np .dtype (np .typecodes ["UnsignedInteger" ][0 ])),
460+ ({ " downcast" : " unsigned"} , np .dtype (np .typecodes ["UnsignedInteger" ][0 ])),
461461 ],
462462)
463463def test_downcast_basic (data , kwargs , exp_dtype ):
0 commit comments