Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix dataframe warning caused by type cast
  • Loading branch information
roxx30198 authored and ZzEeKkAa committed Nov 3, 2023
commit 34cb0516105a5854f2fb3a0ccd1176417b403b96
21 changes: 12 additions & 9 deletions dpbench/infrastructure/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,21 +199,24 @@ def generate_performance_report(
.where(dm.Result.run_id == run_id)
)

df = pd.read_sql_query(
sql=sql,
con=conn.connect(),
df = (
pd.read_sql_query(sql=sql, con=conn.connect())
.astype({impl: "string" for impl in implementations})
.fillna("n/a")
)

for index, row in df.iterrows():
for impl in implementations:
time = row[impl]
if time:
NANOSECONDS_IN_MILISECONDS: Final[float] = 1000 * 1000.0
time /= NANOSECONDS_IN_MILISECONDS

time = str(round(time, 2)) + "ms"
else:
time = "n/a"
if time == "n/a":
pass

NANOSECONDS_IN_MILISECONDS: Final[float] = 1000 * 1000.0
time = float(time)
time /= NANOSECONDS_IN_MILISECONDS

time = str(round(time, 2)) + "ms"

df.at[index, impl] = time

Expand Down