File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 4949from google .api_core import retry as retries
5050
5151from google .cloud .bigquery import job
52+ import google .cloud .bigquery .job .query
5253import google .cloud .bigquery .query
5354from google .cloud .bigquery import table
5455import google .cloud .bigquery .retry
@@ -667,6 +668,16 @@ def _wait_or_cancel(
667668 the job.
668669 """
669670 try :
671+ callback (
672+ QueryReceivedEvent (
673+ billing_project = job .project ,
674+ location = job .location ,
675+ job_id = job .job_id ,
676+ statement_type = job .statement_type ,
677+ state = job .state ,
678+ query_plan = job .query_plan ,
679+ )
680+ )
670681 query_results = job .result (
671682 page_size = page_size ,
672683 max_results = max_results ,
@@ -710,6 +721,18 @@ class QueryFinishedEvent:
710721 slot_millis : Optional [int ]
711722
712723
724+ @dataclasses .dataclass (frozen = True )
725+ class QueryReceivedEvent :
726+ """Query received and acknowledged by the BigQuery API."""
727+
728+ billing_project : str
729+ location : Optional [str ]
730+ job_id : Optional [str ]
731+ statement_type : Optional [str ]
732+ state : Optional [str ]
733+ query_plan : Optional [list [google .cloud .bigquery .job .query .QueryPlanEntry ]]
734+
735+
713736@dataclasses .dataclass (frozen = True )
714737class QuerySentEvent :
715738 """Query sent to BigQuery."""
You can’t perform that action at this time.
0 commit comments