Skip to content

Commit c523987

Browse files
author
Max Wang
committed
black formatting
1 parent 5f6f962 commit c523987

1 file changed

Lines changed: 30 additions & 28 deletions

File tree

tests/unit/test_client_dataframe.py

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,17 @@ def test_get_passes_all_parameters(self):
9696
self.client._odata._get_multiple.return_value = iter([])
9797

9898
# Consume the generator to trigger the underlying call
99-
list(self.client.get_dataframe(
100-
"account",
101-
select=["name"],
102-
filter="statecode eq 0",
103-
orderby=["name asc"],
104-
top=50,
105-
expand=["primarycontactid"],
106-
page_size=25,
107-
))
99+
list(
100+
self.client.get_dataframe(
101+
"account",
102+
select=["name"],
103+
filter="statecode eq 0",
104+
orderby=["name asc"],
105+
top=50,
106+
expand=["primarycontactid"],
107+
page_size=25,
108+
)
109+
)
108110

109111
self.client._odata._get_multiple.assert_called_once_with(
110112
"account",
@@ -128,10 +130,12 @@ def setUp(self):
128130

129131
def test_create_dataframe(self):
130132
"""DataFrame rows are converted to dicts and returned IDs are a Series."""
131-
df = pd.DataFrame([
132-
{"name": "Contoso", "telephone1": "555-0100"},
133-
{"name": "Fabrikam", "telephone1": "555-0200"},
134-
])
133+
df = pd.DataFrame(
134+
[
135+
{"name": "Contoso", "telephone1": "555-0100"},
136+
{"name": "Fabrikam", "telephone1": "555-0200"},
137+
]
138+
)
135139
self.client._odata._create_multiple.return_value = ["guid-1", "guid-2"]
136140
self.client._odata._entity_set_from_schema_name.return_value = "accounts"
137141

@@ -195,10 +199,12 @@ def setUp(self):
195199

196200
def test_update_dataframe(self):
197201
"""DataFrame rows are split into IDs and changes, then passed to update."""
198-
df = pd.DataFrame([
199-
{"accountid": "guid-1", "telephone1": "555-0100"},
200-
{"accountid": "guid-2", "telephone1": "555-0200"},
201-
])
202+
df = pd.DataFrame(
203+
[
204+
{"accountid": "guid-1", "telephone1": "555-0100"},
205+
{"accountid": "guid-2", "telephone1": "555-0200"},
206+
]
207+
)
202208

203209
self.client.update_dataframe("account", df, id_column="accountid")
204210

@@ -223,9 +229,11 @@ def test_update_rejects_missing_id_column(self):
223229

224230
def test_update_multiple_change_columns(self):
225231
"""Multiple change columns are all included in the update payload (single row uses _update)."""
226-
df = pd.DataFrame([
227-
{"accountid": "guid-1", "name": "New Name", "telephone1": "555-0100"},
228-
])
232+
df = pd.DataFrame(
233+
[
234+
{"accountid": "guid-1", "name": "New Name", "telephone1": "555-0100"},
235+
]
236+
)
229237

230238
self.client.update_dataframe("account", df, id_column="accountid")
231239

@@ -256,9 +264,7 @@ def test_delete_dataframe_bulk(self):
256264
job_id = self.client.delete_dataframe("account", ids)
257265

258266
self.assertEqual(job_id, "job-123")
259-
self.client._odata._delete_multiple.assert_called_once_with(
260-
"account", ["guid-1", "guid-2", "guid-3"]
261-
)
267+
self.client._odata._delete_multiple.assert_called_once_with("account", ["guid-1", "guid-2", "guid-3"])
262268

263269
def test_delete_from_dataframe_column(self):
264270
"""Series extracted from a DataFrame column works directly."""
@@ -267,9 +273,7 @@ def test_delete_from_dataframe_column(self):
267273

268274
self.client.delete_dataframe("account", df["accountid"])
269275

270-
self.client._odata._delete_multiple.assert_called_once_with(
271-
"account", ["guid-1", "guid-2"]
272-
)
276+
self.client._odata._delete_multiple.assert_called_once_with("account", ["guid-1", "guid-2"])
273277

274278
def test_delete_dataframe_sequential(self):
275279
"""use_bulk_delete=False deletes records sequentially."""
@@ -293,5 +297,3 @@ def test_delete_empty_series(self):
293297
result = self.client.delete_dataframe("account", ids)
294298

295299
self.assertIsNone(result)
296-
297-

0 commit comments

Comments
 (0)