Skip to content

Commit

Permalink
Change query header text in job error messages
Browse files Browse the repository at this point in the history
It's not always the query that causes the error, thus this commit
makes the header text more neutral.
  • Loading branch information
plamut committed Jul 26, 2019
1 parent f3fa500 commit e6ecbbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bigquery/google/cloud/bigquery/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -2862,7 +2862,7 @@ def _format_for_exception(query, job_id):
lines = query.splitlines()
max_line_len = max(len(l) for l in lines)

header = "-----Offending SQL Follows-----"
header = "-----Query Job SQL Follows-----"
header = "{:^{total_width}}".format(header, total_width=max_line_len + 5)

# Print out a "ruler" above and below the SQL so we can judge columns.
Expand Down
2 changes: 1 addition & 1 deletion bigquery/tests/unit/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -4288,7 +4288,7 @@ def test_result_error(self):
full_text = str(exc_info.exception)

assert job.job_id in full_text
assert "Offending SQL Follows" in full_text
assert "Query Job SQL Follows" in full_text

for i, line in enumerate(query.splitlines(), start=1):
expected_line = "{}:{}".format(i, line)
Expand Down

0 comments on commit e6ecbbf

Please sign in to comment.