diff --git a/bigframes/formatting_helpers.py b/bigframes/formatting_helpers.py index 3c37a3470d..9e5668d7db 100644 --- a/bigframes/formatting_helpers.py +++ b/bigframes/formatting_helpers.py @@ -336,7 +336,7 @@ def get_job_url( """ if project_id is None or location is None or job_id is None: return None - return f"""https://console.cloud. google.com/bigquery?project={project_id}&j=bq:{location}:{job_id}&page=queryresults""" + return f"""https://console.cloud.google.com/bigquery?project={project_id}&j=bq:{location}:{job_id}&page=queryresults""" def render_bqquery_sent_event_html( diff --git a/tests/unit/test_formatting_helpers.py b/tests/unit/test_formatting_helpers.py index 7a1cf1ab13..ec681b36ab 100644 --- a/tests/unit/test_formatting_helpers.py +++ b/tests/unit/test_formatting_helpers.py @@ -197,3 +197,18 @@ def test_render_bqquery_finished_event_plaintext(): assert "finished" in text assert "1.0 kB processed" in text assert "Slot time: 2 seconds" in text + + +def test_get_job_url(): + job_id = "my-job-id" + location = "us-central1" + project_id = "my-project" + expected_url = ( + f"https://console.cloud.google.com/bigquery?project={project_id}" + f"&j=bq:{location}:{job_id}&page=queryresults" + ) + + actual_url = formatting_helpers.get_job_url( + job_id=job_id, location=location, project_id=project_id + ) + assert actual_url == expected_url