Skip to content

Commit 1028c86

Browse files
francois-baptisteFrançois BAPTISTE
authored and
François BAPTISTE
committed
fix: Call repr for non built-in type objects only
1 parent 73addd0 commit 1028c86

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

google/cloud/bigquery/table.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2128,9 +2128,11 @@ def to_api_repr(self):
21282128
return self._properties
21292129

21302130
def _key(self):
2131+
# because we are only "renaming" top level keys shallow copy is sufficient here.
21312132
properties = self._properties.copy()
21322133
if "type" in properties.keys():
2133-
properties["type_"] = properties.pop("type")
2134+
# calling repr for non built-in type objects.
2135+
properties["type_"] = repr(properties.pop("type"))
21342136
if "requirePartitionFilter" in properties.keys():
21352137
properties["require_partition_filter"] = properties.pop("requirePartitionFilter")
21362138
if "expirationMs" in properties.keys():
@@ -2149,7 +2151,7 @@ def __hash__(self):
21492151
return hash(self._key())
21502152

21512153
def __repr__(self):
2152-
key_vals = ["{}={}".format(key, repr(val)) for key, val in self._key()]
2154+
key_vals = ["{}={}".format(key, val) for key, val in self._key()]
21532155
return "TimePartitioning({})".format(",".join(key_vals))
21542156

21552157

0 commit comments

Comments
 (0)