Skip to content

Commit cf848fd

Browse files
francois-baptisteFrançois BAPTISTE
authored and
François BAPTISTE
committed
Makes TimePartitioning printable representation evaluable
1 parent 23a173b commit cf848fd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

google/cloud/bigquery/table.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2005,13 +2005,13 @@ class TimePartitioning(object):
20052005
"""
20062006

20072007
def __init__(
2008-
self, type_=None, field=None, expiration_ms=None, require_partition_filter=None
2008+
self, type=None, field=None, expiration_ms=None, require_partition_filter=None
20092009
):
20102010
self._properties = {}
2011-
if type_ is None:
2011+
if type is None:
20122012
self.type_ = TimePartitioningType.DAY
20132013
else:
2014-
self.type_ = type_
2014+
self.type_ = type
20152015
if field is not None:
20162016
self.field = field
20172017
if expiration_ms is not None:
@@ -2142,7 +2142,7 @@ def __hash__(self):
21422142
return hash(self._key())
21432143

21442144
def __repr__(self):
2145-
key_vals = ["{}={}".format(key, val) for key, val in self._key()]
2145+
key_vals = ["{}={}".format(key, val.__repr__()) for key, val in self._key()]
21462146
return "TimePartitioning({})".format(",".join(key_vals))
21472147

21482148

0 commit comments

Comments
 (0)