Skip to content

Commit ec1d5f6

Browse files
committed
add columns filling for --forked
1 parent 5adaf4f commit ec1d5f6

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

tests/post_training/test_quantize_conformance.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,22 @@ def fixture_report_data(output_dir, run_benchmark_app, pytestconfig):
190190
if pytestconfig.getoption("forked") and output_file.exists():
191191
# When run test with --forked to run test in separate process
192192
# Used in post_training_performance jobs
193-
df.to_csv(output_file, index=False, mode="a", header=False)
193+
existing_df = pd.read_csv(output_file)
194+
195+
# Ensure all columns are present in both DataFrames
196+
for column in existing_df.columns:
197+
if column not in df.columns:
198+
df[column] = None
199+
for column in df.columns:
200+
if column not in existing_df.columns:
201+
existing_df[column] = None
202+
203+
# Reorder columns to match
204+
df = df[existing_df.columns]
205+
206+
# Append new data to existing data
207+
combined_df = pd.concat([existing_df, df], ignore_index=True)
208+
combined_df.to_csv(output_file, index=False)
194209
else:
195210
df.to_csv(output_file, index=False)
196211

0 commit comments

Comments
 (0)