File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
google/cloud/bigquery/job Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -722,6 +722,14 @@ def cancelled(self):
722722 and self .error_result .get ("reason" ) == _STOPPED_REASON
723723 )
724724
725+ def __repr__ (self ):
726+ result = (
727+ f"{ self .__class__ .__name__ } <"
728+ f"project={ self .project } , location={ self .location } , id={ self .job_id } "
729+ ">"
730+ )
731+ return result
732+
725733
726734class _JobConfig (object ):
727735 """Abstract base class for job configuration objects.
Original file line number Diff line number Diff line change @@ -1043,6 +1043,12 @@ def test_cancelled_w_error_result_w_stopped(self):
10431043
10441044 self .assertTrue (job .cancelled ())
10451045
1046+ def test_repr (self ):
1047+ client = _make_client (project = "project-foo" )
1048+ job = self ._make_one ("job-99" , client )
1049+ job ._properties .setdefault ("jobReference" , {})["location" ] = "ABC"
1050+ assert repr (job ) == "_AsyncJob<project=project-foo, location=ABC, id=job-99>"
1051+
10461052
10471053class Test_JobConfig (unittest .TestCase ):
10481054 JOB_TYPE = "testing"
You can’t perform that action at this time.
0 commit comments