Skip to content

Commit

Permalink
Merge branch 'main' into pangea-v1alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
chalmerlowe authored Dec 6, 2024
2 parents 1fcbc09 + 3359ef3 commit 07bc30a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
23 changes: 23 additions & 0 deletions google/cloud/bigquery/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ class Table(_TableBase):
"mview_last_refresh_time": ["materializedView", "lastRefreshTime"],
"mview_query": "materializedView",
"mview_refresh_interval": "materializedView",
"mview_allow_non_incremental_definition": "materializedView",
"num_bytes": "numBytes",
"num_rows": "numRows",
"partition_expiration": "timePartitioning",
Expand Down Expand Up @@ -931,6 +932,28 @@ def mview_refresh_interval(self, value):
refresh_interval_ms,
)

@property
def mview_allow_non_incremental_definition(self):
"""Optional[bool]: This option declares the intention to construct a
materialized view that isn't refreshed incrementally.
The default value is :data:`False`.
"""
api_field = self._PROPERTY_TO_API_FIELD[
"mview_allow_non_incremental_definition"
]
return _helpers._get_sub_prop(
self._properties, [api_field, "allowNonIncrementalDefinition"]
)

@mview_allow_non_incremental_definition.setter
def mview_allow_non_incremental_definition(self, value):
api_field = self._PROPERTY_TO_API_FIELD[
"mview_allow_non_incremental_definition"
]
_helpers._set_sub_prop(
self._properties, [api_field, "allowNonIncrementalDefinition"], value
)

@property
def streaming_buffer(self):
"""google.cloud.bigquery.StreamingBuffer: Information about a table's
Expand Down
2 changes: 1 addition & 1 deletion samples/geography/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pandas==2.2.3; python_version >= '3.9'
proto-plus==1.25.0
pyarrow===12.0.1; python_version == '3.7'
pyarrow===17.0.0; python_version == '3.8'
pyarrow==18.0.0; python_version >= '3.9'
pyarrow==18.1.0; python_version >= '3.9'
pyasn1===0.5.1; python_version == '3.7'
pyasn1==0.6.1; python_version >= '3.8'
pyasn1-modules===0.3.0; python_version == '3.7'
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,16 @@ def test_mview_refresh_interval(self):
table.mview_refresh_interval = None
self.assertIsNone(table.mview_refresh_interval)

def test_mview_allow_non_incremental_definition(self):
table = self._make_one()
self.assertIsNone(table.mview_allow_non_incremental_definition)
table.mview_allow_non_incremental_definition = True
self.assertTrue(table.mview_allow_non_incremental_definition)
table.mview_allow_non_incremental_definition = False
self.assertFalse(table.mview_allow_non_incremental_definition)
table.mview_allow_non_incremental_definition = None
self.assertIsNone(table.mview_allow_non_incremental_definition)

def test_from_string(self):
cls = self._get_target_class()
got = cls.from_string("string-project.string_dataset.string_table")
Expand Down

0 comments on commit 07bc30a

Please sign in to comment.