File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ def do_query():
145
145
try :
146
146
query_job ._begin (retry = retry , timeout = timeout )
147
147
callback (
148
- QueryRequestedEvent (
148
+ QuerySentEvent (
149
149
query = query ,
150
150
billing_project = query_job .project ,
151
151
location = query_job .location ,
@@ -522,7 +522,7 @@ def do_query():
522
522
span_attributes = {"path" : path }
523
523
524
524
callback (
525
- QueryRequestedEvent (
525
+ QuerySentEvent (
526
526
query = query ,
527
527
billing_project = project ,
528
528
location = location ,
@@ -666,7 +666,7 @@ def _wait_or_cancel(
666
666
667
667
668
668
@dataclasses .dataclass (frozen = True )
669
- class QueryRequestedEvent :
669
+ class QuerySentEvent :
670
670
query : str
671
671
billing_project : str
672
672
location : Optional [str ]
Original file line number Diff line number Diff line change 22
22
23
23
import google .auth .credentials
24
24
import google .cloud .bigquery .client
25
+ from google .cloud .bigquery import _job_helpers
25
26
26
27
27
28
PROJECT = "test-project"
@@ -51,5 +52,12 @@ def test_query_and_wait_bigframes_callback(client):
51
52
{"jobComplete" : True }
52
53
),
53
54
]
54
- callback = lambda _ : None
55
+ callback = mock . Mock ()
55
56
client ._query_and_wait_bigframes (query = "SELECT 1" , callback = callback )
57
+ callback .assert_has_calls (
58
+ mock .call (
59
+ _job_helpers .QuerySentEvent (
60
+ query = "SELECT 1" ,
61
+ ),
62
+ )
63
+ )
You can’t perform that action at this time.
0 commit comments