@@ -36,10 +36,12 @@ class TestBatchDataFrameCreate(unittest.TestCase):
3636
3737 def test_create_from_dataframe (self ):
3838 batch = _make_batch ()
39- df = pd .DataFrame ([
40- {"name" : "Contoso" , "telephone1" : "555-0100" },
41- {"name" : "Fabrikam" , "telephone1" : "555-0200" },
42- ])
39+ df = pd .DataFrame (
40+ [
41+ {"name" : "Contoso" , "telephone1" : "555-0100" },
42+ {"name" : "Fabrikam" , "telephone1" : "555-0200" },
43+ ]
44+ )
4345 batch .dataframe .create ("account" , df )
4446 # Should have enqueued a _RecordCreate with a list of dicts
4547 self .assertEqual (len (batch ._items ), 1 )
@@ -82,10 +84,12 @@ def test_create_rejects_rows_with_all_nan(self):
8284 def test_create_handles_nan_values (self ):
8385 """NaN values are dropped from individual records by default."""
8486 batch = _make_batch ()
85- df = pd .DataFrame ([
86- {"name" : "Contoso" , "telephone1" : "555-0100" },
87- {"name" : "Fabrikam" , "telephone1" : None },
88- ])
87+ df = pd .DataFrame (
88+ [
89+ {"name" : "Contoso" , "telephone1" : "555-0100" },
90+ {"name" : "Fabrikam" , "telephone1" : None },
91+ ]
92+ )
8993 batch .dataframe .create ("account" , df )
9094 item = batch ._items [0 ]
9195 # Second record should not have telephone1
@@ -98,10 +102,12 @@ class TestBatchDataFrameUpdate(unittest.TestCase):
98102
99103 def test_update_enqueues_record_update (self ):
100104 batch = _make_batch ()
101- df = pd .DataFrame ([
102- {"accountid" : "guid-1" , "telephone1" : "555-0100" },
103- {"accountid" : "guid-2" , "telephone1" : "555-0200" },
104- ])
105+ df = pd .DataFrame (
106+ [
107+ {"accountid" : "guid-1" , "telephone1" : "555-0100" },
108+ {"accountid" : "guid-2" , "telephone1" : "555-0200" },
109+ ]
110+ )
105111 batch .dataframe .update ("account" , df , id_column = "accountid" )
106112 self .assertEqual (len (batch ._items ), 1 )
107113 item = batch ._items [0 ]
@@ -139,9 +145,11 @@ def test_update_rejects_invalid_ids(self):
139145 def test_update_skips_all_nan_rows (self ):
140146 """Rows where all change values are NaN are silently skipped."""
141147 batch = _make_batch ()
142- df = pd .DataFrame ([
143- {"accountid" : "guid-1" , "name" : None },
144- ])
148+ df = pd .DataFrame (
149+ [
150+ {"accountid" : "guid-1" , "name" : None },
151+ ]
152+ )
145153 batch .dataframe .update ("account" , df , id_column = "accountid" )
146154 # Nothing enqueued because all change values were NaN
147155 self .assertEqual (len (batch ._items ), 0 )
0 commit comments