Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitacca1cb

Browse files
authored
feat: include key metadata in Job representation (#964)
1 parent9157537 commitacca1cb

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎google/cloud/bigquery/job/base.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,14 @@ def cancelled(self):
722722
andself.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+
returnresult
732+
725733

726734
class_JobConfig(object):
727735
"""Abstract base class for job configuration objects.

‎tests/unit/job/test_base.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,12 @@ def test_cancelled_w_error_result_w_stopped(self):
10431043

10441044
self.assertTrue(job.cancelled())
10451045

1046+
deftest_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+
assertrepr(job)=="_AsyncJob<project=project-foo, location=ABC, id=job-99>"
1051+
10461052

10471053
classTest_JobConfig(unittest.TestCase):
10481054
JOB_TYPE="testing"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp