Skip to content

Commit 9a3148f

Browse files
committed
rename
1 parent f6852e3 commit 9a3148f

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

google/cloud/bigquery/_job_helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def do_query():
145145
try:
146146
query_job._begin(retry=retry, timeout=timeout)
147147
callback(
148-
QueryRequestedEvent(
148+
QuerySentEvent(
149149
query=query,
150150
billing_project=query_job.project,
151151
location=query_job.location,
@@ -522,7 +522,7 @@ def do_query():
522522
span_attributes = {"path": path}
523523

524524
callback(
525-
QueryRequestedEvent(
525+
QuerySentEvent(
526526
query=query,
527527
billing_project=project,
528528
location=location,
@@ -666,7 +666,7 @@ def _wait_or_cancel(
666666

667667

668668
@dataclasses.dataclass(frozen=True)
669-
class QueryRequestedEvent:
669+
class QuerySentEvent:
670670
query: str
671671
billing_project: str
672672
location: Optional[str]

tests/unit/test_client_bigframes.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
import google.auth.credentials
2424
import google.cloud.bigquery.client
25+
from google.cloud.bigquery import _job_helpers
2526

2627

2728
PROJECT = "test-project"
@@ -51,5 +52,12 @@ def test_query_and_wait_bigframes_callback(client):
5152
{"jobComplete": True}
5253
),
5354
]
54-
callback = lambda _: None
55+
callback = mock.Mock()
5556
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+
)

0 commit comments

Comments
 (0)