diff --git a/bigframes/session/loader.py b/bigframes/session/loader.py index add4efb6ab..c264abd860 100644 --- a/bigframes/session/loader.py +++ b/bigframes/session/loader.py @@ -983,6 +983,8 @@ def read_gbq_query( ) job_config.dry_run = True query_job = self._bqclient.query(query, job_config=job_config) + if self._metrics is not None: + self._metrics.count_job_stats(query_job=query_job) return dry_runs.get_query_stats_with_inferred_dtypes( query_job, list(columns), index_cols ) diff --git a/bigframes/session/metrics.py b/bigframes/session/metrics.py index 48cb92a8b4..75f247b028 100644 --- a/bigframes/session/metrics.py +++ b/bigframes/session/metrics.py @@ -51,6 +51,9 @@ def count_job_stats( write_stats_to_disk(len(query), total_bytes_processed) return + if query_job.configuration.dry_run: + write_stats_to_disk(len(query_job.query), 0, 0, 0) + stats = get_performance_stats(query_job) if stats is not None: query_char_count, bytes_processed, slot_millis, execution_secs = stats diff --git a/scripts/run_and_publish_benchmark.py b/scripts/run_and_publish_benchmark.py index 0ea3a5e162..248322f619 100644 --- a/scripts/run_and_publish_benchmark.py +++ b/scripts/run_and_publish_benchmark.py @@ -100,7 +100,12 @@ def collect_benchmark_result( == len(local_seconds_files) ): raise ValueError( - "Mismatch in the number of report files for bytes, millis, seconds and query char count." + "Mismatch in the number of report files for bytes, millis, seconds and query char count: \n" + f"millis_files: {len(millis_files)}\n" + f"bq_seconds_files: {len(bq_seconds_files)}\n" + f"bytes_files: {len(bytes_files)}\n" + f"query_char_count_files: {len(query_char_count_files)}\n" + f"local_seconds_files: {len(local_seconds_files)}\n" ) has_full_metrics = len(bq_seconds_files) == len(local_seconds_files)