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 0dd90b9

Browse filesBrowse files
authored
feat: add HOUR support for time partitioning interval (#91)
* feat: add HOUR support for time partitioning interval
1 parent 834e2c0 commit 0dd90b9
Copy full SHA for 0dd90b9

File tree

Expand file treeCollapse file tree

2 files changed

+5
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-4
lines changed
Open diff view settings
Collapse file

‎google/cloud/bigquery/table.py‎

Copy file name to clipboardExpand all lines: google/cloud/bigquery/table.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,6 @@ def partitioning_type(self):
583583
"""Union[str, None]: Time partitioning of the table if it is
584584
partitioned (Defaults to :data:`None`).
585585
586-
The only partitioning type that is currently supported is
587-
:attr:`~google.cloud.bigquery.table.TimePartitioningType.DAY`.
588586
"""
589587
warnings.warn(
590588
"This method will be deprecated in future versions. Please use "
@@ -1980,6 +1978,9 @@ class TimePartitioningType(object):
19801978
DAY = "DAY"
19811979
"""str: Generates one partition per day."""
19821980

1981+
HOUR = "HOUR"
1982+
"""str: Generates one partition per hour."""
1983+
19831984

19841985
class TimePartitioning(object):
19851986
"""Configures time-based partitioning for a table.
Collapse file

‎tests/unit/test_table.py‎

Copy file name to clipboardExpand all lines: tests/unit/test_table.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,11 +1024,11 @@ def test_time_partitioning_setter(self):
10241024
dataset = DatasetReference(self.PROJECT, self.DS_ID)
10251025
table_ref = dataset.table(self.TABLE_NAME)
10261026
table = self._make_one(table_ref)
1027-
time_partitioning = TimePartitioning(type_=TimePartitioningType.DAY)
1027+
time_partitioning = TimePartitioning(type_=TimePartitioningType.HOUR)
10281028

10291029
table.time_partitioning = time_partitioning
10301030

1031-
self.assertEqual(table.time_partitioning.type_, TimePartitioningType.DAY)
1031+
self.assertEqual(table.time_partitioning.type_, TimePartitioningType.HOUR)
10321032
# Both objects point to the same properties dict
10331033
self.assertIs(
10341034
table._properties["timePartitioning"], time_partitioning._properties

0 commit comments

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