Skip to content

Commit abc25cf

Browse files
authored
Merge pull request #367 from simvue-io/hotfix/remove-format-shadowing
Remove shadowing of Python 'format' keyword
2 parents dc5ca06 + 7f899e0 commit abc25cf

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

simvue/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def get_runs(
269269
metrics: bool = False,
270270
alerts: bool = False,
271271
metadata: bool = False,
272-
format: typing.Literal["dict", "dataframe"] = "dict",
272+
output_format: typing.Literal["dict", "dataframe"] = "dict",
273273
count: int = 100,
274274
start_index: int = 0,
275275
) -> typing.Union[
@@ -291,7 +291,7 @@ def get_runs(
291291
alerts : bool, optional
292292
whether to include alert information in the response.
293293
Default False.
294-
format : Literal['dict', 'dataframe'], optional
294+
output_format : Literal['dict', 'dataframe'], optional
295295
the structure of the response, either a dictionary or a dataframe.
296296
Default is 'dict'. Pandas must be installed for 'dataframe'.
297297
count : int, optional
@@ -329,7 +329,7 @@ def get_runs(
329329

330330
response.raise_for_status()
331331

332-
if format not in ("dict", "dataframe"):
332+
if output_format not in ("dict", "dataframe"):
333333
raise ValueError("Invalid format specified")
334334

335335
json_response = self._get_json_from_response(
@@ -344,7 +344,7 @@ def get_runs(
344344

345345
if response_data := json_response.get("data"):
346346
return response_data
347-
elif format == "dataframe":
347+
elif output_format == "dataframe":
348348
return to_dataframe(response.json())
349349
else:
350350
raise RuntimeError("Failed to retrieve runs data")

tests/refactor/test_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,16 @@ def test_folder_deletion(create_test_run: tuple[sv_run.Run, dict]) -> None:
203203
@pytest.mark.dependency
204204
@pytest.mark.client
205205
@pytest.mark.parametrize("aggregate", (True, False), ids=("aggregated", "normal"))
206-
@pytest.mark.parametrize("format", ("dict", "dataframe"))
206+
@pytest.mark.parametrize("output_format", ("dict", "dataframe"))
207207
@pytest.mark.parametrize("xaxis", ("step", "time", "timestamp"))
208208
def test_multiple_metric_retrieval(
209209
create_test_run: tuple[sv_run.Run, dict],
210210
aggregate: bool,
211-
format: typing.Literal["dict", "dataframe"],
211+
output_format: typing.Literal["dict", "dataframe"],
212212
xaxis: typing.Literal["step", "time", "timestamp"],
213213
) -> None:
214214
client = svc.Client()
215-
if format == "dataframe":
215+
if output_format == "dataframe":
216216
try:
217217
import pandas
218218
except ImportError:

0 commit comments

Comments
 (0)