Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit f7a2768

Browse files
committed
Updates access_policy_version setter and unittest
1 parent fc4882c commit f7a2768

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

google/cloud/bigquery/dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ def access_policy_version(self):
988988
def access_policy_version(self, value):
989989
if not isinstance(value, int) and value is not None:
990990
raise ValueError("Pass an integer, or None")
991-
self._properties[self._PROPERTY_TO_API_FIELD["access_policy_version"]] = value
991+
self._properties["accessPolicyVersion"] = value
992992

993993
@classmethod
994994
def from_string(cls, full_dataset_id: str) -> "Dataset":

tests/unit/test_dataset.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,8 @@ def test_access_policy_version_valid_input(self):
14281428
dataset = self._make_one(self.DS_REF)
14291429
# Valid inputs for access_policy_version are currently
14301430
# ints 1, 2, 3, and None
1431+
# We rely upon the BQ backend to validate acceptable integer
1432+
# values, rather than perform that validation in the client.
14311433
for expected in [1, 2, 3, None]:
14321434
# set property using setter and integer
14331435
dataset.access_policy_version = expected

0 commit comments

Comments
 (0)