From 9e6f770b6385a31d55e17e6ead4ed5b2c8b05a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20BAPTISTE?= Date: Mon, 18 May 2020 11:01:53 +0200 Subject: [PATCH] fix: Makes TimePartitioning printable representation evaluable --- google/cloud/bigquery/table.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/google/cloud/bigquery/table.py b/google/cloud/bigquery/table.py index e66d24e74..2a287a046 100644 --- a/google/cloud/bigquery/table.py +++ b/google/cloud/bigquery/table.py @@ -2005,13 +2005,13 @@ class TimePartitioning(object): """ def __init__( - self, type_=None, field=None, expiration_ms=None, require_partition_filter=None + self, type=None, field=None, expiration_ms=None, require_partition_filter=None ): self._properties = {} - if type_ is None: + if type is None: self.type_ = TimePartitioningType.DAY else: - self.type_ = type_ + self.type_ = type if field is not None: self.field = field if expiration_ms is not None: @@ -2142,7 +2142,7 @@ def __hash__(self): return hash(self._key()) def __repr__(self): - key_vals = ["{}={}".format(key, val) for key, val in self._key()] + key_vals = ["{}={}".format(key, val.__repr__()) for key, val in self._key()] return "TimePartitioning({})".format(",".join(key_vals))