This repository was archived by the owner on Mar 13, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -245,24 +245,14 @@ def run_query(
245245 timeout_ms = timeout_ms ,
246246 )
247247
248- dtypes = kwargs .get ("dtypes" )
249-
250248 if dry_run :
251- # Access total_bytes_processed from the QueryJob via RowIterator.job
252- # RowIterator has a job attribute that references the QueryJob
253- if hasattr (rows_iter , "job" ) and rows_iter .job :
254- return dry_runs .get_query_stats (rows_iter .job )
255-
256- # Fallback: if query_and_wait_via_client_library doesn't set job,
257- # we need to get it from the query result
258- # For query_and_wait_via_client_library, the RowIterator should have job set
259- raise ValueError ("Cannot access QueryJob from RowIterator for dry_run" )
249+ return dry_runs .get_query_stats (rows_iter .job )
260250
261251 return self ._download_results (
262252 rows_iter ,
263253 max_results = max_results ,
264254 progress_bar_type = progress_bar_type ,
265- user_dtypes = dtypes ,
255+ user_dtypes = kwargs . get ( " dtypes" ) ,
266256 )
267257
268258 def _download_results (
You can’t perform that action at this time.
0 commit comments