We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ab89c3 commit 62028bcCopy full SHA for 62028bc
tests/unit/test_table.py
@@ -1000,6 +1000,19 @@ def test_table_constraints_property_setter_only_foriegn_keys(self):
1000
]
1001
}
1002
1003
+ def test_table_constraints_property_setter_no_constraints(self):
1004
+ from google.cloud.bigquery.table import TableConstraints
1005
+
1006
+ dataset = DatasetReference(self.PROJECT, self.DS_ID)
1007
+ table_ref = dataset.table(self.TABLE_NAME)
1008
+ table = self._make_one(table_ref)
1009
1010
1011
+ table_constraints = TableConstraints(primary_key=None, foreign_keys=None)
1012
+ table.table_constraints = table_constraints
1013
1014
+ assert table._properties["tableConstraints"] == {}
1015
1016
def test_description_setter_bad_value(self):
1017
dataset = DatasetReference(self.PROJECT, self.DS_ID)
1018
table_ref = dataset.table(self.TABLE_NAME)
0 commit comments