-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: resource tags in dataset (#2090)
* feat: resource tags in dataset * fix: fix unittets * Delete dataset/pyvenv.cfg * Update google/cloud/bigquery/dataset.py Co-authored-by: Lingqing Gan <[email protected]> * Update google/cloud/bigquery/dataset.py Co-authored-by: Lingqing Gan <[email protected]> * added system tests & fix unittest for none * add missing assert * remove venv * include resourcemanager in noxfile.py * fix fixture for tag keys * register tags before using in tests * handle alreadyexist error * fix: tag keys & values creation & deletion * fix comment * make tag keys unique * remove unused import --------- Co-authored-by: Lingqing Gan <[email protected]>
- Loading branch information
1 parent
6be0272
commit 3e13016
Showing
6 changed files
with
148 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2028,6 +2028,7 @@ def test_update_dataset(self): | |
LABELS = {"priority": "high"} | ||
ACCESS = [{"role": "OWNER", "userByEmail": "[email protected]"}] | ||
EXP = 17 | ||
RESOURCE_TAGS = {"123456789012/key": "value"} | ||
RESOURCE = { | ||
"datasetReference": {"projectId": self.PROJECT, "datasetId": self.DS_ID}, | ||
"etag": "etag", | ||
|
@@ -2037,6 +2038,7 @@ def test_update_dataset(self): | |
"defaultTableExpirationMs": EXP, | ||
"labels": LABELS, | ||
"access": ACCESS, | ||
"resourceTags": RESOURCE_TAGS, | ||
} | ||
creds = _make_credentials() | ||
client = self._make_one(project=self.PROJECT, credentials=creds) | ||
|
@@ -2048,12 +2050,14 @@ def test_update_dataset(self): | |
ds.default_table_expiration_ms = EXP | ||
ds.labels = LABELS | ||
ds.access_entries = [AccessEntry("OWNER", "userByEmail", "[email protected]")] | ||
ds.resource_tags = RESOURCE_TAGS | ||
fields = [ | ||
"description", | ||
"friendly_name", | ||
"location", | ||
"labels", | ||
"access_entries", | ||
"resource_tags", | ||
] | ||
|
||
with mock.patch( | ||
|
@@ -2077,6 +2081,7 @@ def test_update_dataset(self): | |
"location": LOCATION, | ||
"labels": LABELS, | ||
"access": ACCESS, | ||
"resourceTags": RESOURCE_TAGS, | ||
}, | ||
path="/" + PATH, | ||
timeout=7.5, | ||
|
@@ -2086,6 +2091,7 @@ def test_update_dataset(self): | |
self.assertEqual(ds2.location, ds.location) | ||
self.assertEqual(ds2.labels, ds.labels) | ||
self.assertEqual(ds2.access_entries, ds.access_entries) | ||
self.assertEqual(ds2.resource_tags, ds.resource_tags) | ||
|
||
# ETag becomes If-Match header. | ||
ds._properties["etag"] = "etag" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters