Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bigframes/formatting_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
15 changes: 15 additions & 0 deletions tests/unit/test_formatting_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading