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

Appearance settings

Commit e9ddb89

Browse filesBrowse files
tswasttseaver
authored andcommitted
Allow setting partition expiration to 'None'. (googleapis#6823)
1 parent 1e8907b commit e9ddb89
Copy full SHA for e9ddb89

File tree

Expand file treeCollapse file tree

2 files changed

+9
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-1
lines changed

‎bigquery/google/cloud/bigquery/table.py

Copy file name to clipboardExpand all lines: bigquery/google/cloud/bigquery/table.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,10 @@ def expiration_ms(self):
13351335

13361336
@expiration_ms.setter
13371337
def expiration_ms(self, value):
1338-
self._properties["expirationMs"] = str(value)
1338+
if value is not None:
1339+
# Allow explicitly setting the expiration to None.
1340+
value = str(value)
1341+
self._properties["expirationMs"] = value
13391342

13401343
@property
13411344
def require_partition_filter(self):

‎bigquery/tests/unit/test_table.py

Copy file name to clipboardExpand all lines: bigquery/tests/unit/test_table.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,3 +1683,8 @@ def test___repr___explicit(self):
16831683
"type=DAY)"
16841684
)
16851685
self.assertEqual(repr(time_partitioning), expected)
1686+
1687+
def test_set_expiration_w_none(self):
1688+
time_partitioning = self._make_one()
1689+
time_partitioning.expiration_ms = None
1690+
assert time_partitioning._properties["expirationMs"] is None

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.