Skip to content

Commit fcb5bc1

Browse files
authored
fix: broken job url (#2411)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #2410 🦕
1 parent 83b83ea commit fcb5bc1

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

bigframes/formatting_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def get_job_url(
336336
"""
337337
if project_id is None or location is None or job_id is None:
338338
return None
339-
return f"""https://console.cloud. google.com/bigquery?project={project_id}&j=bq:{location}:{job_id}&page=queryresults"""
339+
return f"""https://console.cloud.google.com/bigquery?project={project_id}&j=bq:{location}:{job_id}&page=queryresults"""
340340

341341

342342
def render_bqquery_sent_event_html(

tests/unit/test_formatting_helpers.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,18 @@ def test_render_bqquery_finished_event_plaintext():
197197
assert "finished" in text
198198
assert "1.0 kB processed" in text
199199
assert "Slot time: 2 seconds" in text
200+
201+
202+
def test_get_job_url():
203+
job_id = "my-job-id"
204+
location = "us-central1"
205+
project_id = "my-project"
206+
expected_url = (
207+
f"https://console.cloud.google.com/bigquery?project={project_id}"
208+
f"&j=bq:{location}:{job_id}&page=queryresults"
209+
)
210+
211+
actual_url = formatting_helpers.get_job_url(
212+
job_id=job_id, location=location, project_id=project_id
213+
)
214+
assert actual_url == expected_url

0 commit comments

Comments
 (0)