Skip to content

Commit 2baa0e0

Browse files
authored
chore: fix benchmark file count mismatch issue. (#1909)
* chore: fix benchmark file count mismatch issue. * reverse
1 parent 15b8449 commit 2baa0e0

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

bigframes/session/loader.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,8 @@ def read_gbq_query(
983983
)
984984
job_config.dry_run = True
985985
query_job = self._bqclient.query(query, job_config=job_config)
986+
if self._metrics is not None:
987+
self._metrics.count_job_stats(query_job=query_job)
986988
return dry_runs.get_query_stats_with_inferred_dtypes(
987989
query_job, list(columns), index_cols
988990
)

bigframes/session/metrics.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ def count_job_stats(
5151
write_stats_to_disk(len(query), total_bytes_processed)
5252
return
5353

54+
if query_job.configuration.dry_run:
55+
write_stats_to_disk(len(query_job.query), 0, 0, 0)
56+
5457
stats = get_performance_stats(query_job)
5558
if stats is not None:
5659
query_char_count, bytes_processed, slot_millis, execution_secs = stats

scripts/run_and_publish_benchmark.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ def collect_benchmark_result(
100100
== len(local_seconds_files)
101101
):
102102
raise ValueError(
103-
"Mismatch in the number of report files for bytes, millis, seconds and query char count."
103+
"Mismatch in the number of report files for bytes, millis, seconds and query char count: \n"
104+
f"millis_files: {len(millis_files)}\n"
105+
f"bq_seconds_files: {len(bq_seconds_files)}\n"
106+
f"bytes_files: {len(bytes_files)}\n"
107+
f"query_char_count_files: {len(query_char_count_files)}\n"
108+
f"local_seconds_files: {len(local_seconds_files)}\n"
104109
)
105110

106111
has_full_metrics = len(bq_seconds_files) == len(local_seconds_files)

0 commit comments

Comments
 (0)