Skip to content

Commit a882a7c

Browse files
committed
rewriting file handler
1 parent 0357869 commit a882a7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

prober/probes/put_fetch_get.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def generate_random_data(num_records: int, file_path: str) -> str:
3030
writer.writerow(["id", "name", "email", "address"])
3131
for i in range(1, num_records + 1):
3232
writer.writerow([i, fake.name(), fake.email(), fake.address()])
33-
with open(file_path, mode="r", newline="", encoding="utf-8") as csvfile:
33+
with open(file_path, newline="", encoding="utf-8") as csvfile:
3434
reader = csv.reader(csvfile)
3535
rows = list(reader)
3636
# Subtract 1 for the header row
@@ -162,7 +162,7 @@ def compare_fetched_data(
162162
f"SELECT * FROM {table_name} LIMIT {fetch_limit}"
163163
).fetchall()
164164

165-
with open(file_name, mode="r", newline="", encoding="utf-8") as csvfile:
165+
with open(file_name, newline="", encoding="utf-8") as csvfile:
166166
reader = csv.reader(csvfile)
167167
csv_data = list(reader)[1:] # Skip header row
168168
for _ in range(repetitions):

0 commit comments

Comments
 (0)