Skip to content

Commit f9e9b13

Browse files
fix(benchmark): ruff format + mypy type annotation
1 parent 9c0e129 commit f9e9b13

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

tests/benchmark/test_add_files_dup_check_benchmark.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import tempfile
3434
import tracemalloc
3535
from pathlib import Path
36+
from typing import Any
3637

3738
import pyarrow as pa
3839
import pyarrow.parquet as pq
@@ -66,13 +67,10 @@ def _wide_schema(num_columns: int = 30) -> tuple[Schema, pa.Schema]:
6667

6768
def _write_files(work_dir: Path, batch_idx: int, n_files: int, arrow_schema: pa.Schema) -> list[str]:
6869
paths: list[str] = []
69-
rows = pa.Table.from_pydict(
70-
{
71-
name: list(range(8)) if name == "id" else [f"v{batch_idx}-{j}" for j in range(8)]
72-
for name in arrow_schema.names
73-
},
74-
schema=arrow_schema,
75-
)
70+
columns: dict[str, list[Any]] = {
71+
name: list(range(8)) if name == "id" else [f"v{batch_idx}-{j}" for j in range(8)] for name in arrow_schema.names
72+
}
73+
rows = pa.Table.from_pydict(columns, schema=arrow_schema)
7674
for i in range(n_files):
7775
p = work_dir / f"batch_{batch_idx:03d}_file_{i:05d}.parquet"
7876
pq.write_table(rows, p)

0 commit comments

Comments
 (0)