File tree 2 files changed +14
-0
lines changed
google/cloud/bigquery/job
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -722,6 +722,14 @@ def cancelled(self):
722
722
and self .error_result .get ("reason" ) == _STOPPED_REASON
723
723
)
724
724
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
+
725
733
726
734
class _JobConfig (object ):
727
735
"""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):
1043
1043
1044
1044
self .assertTrue (job .cancelled ())
1045
1045
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
+
1046
1052
1047
1053
class Test_JobConfig (unittest .TestCase ):
1048
1054
JOB_TYPE = "testing"
You can’t perform that action at this time.
0 commit comments