From 15552ce7eea318c01e1c738985cca85936323684 Mon Sep 17 00:00:00 2001 From: sasha-gitg <44654632+sasha-gitg@users.noreply.github.com> Date: Thu, 20 May 2021 11:54:32 -0400 Subject: [PATCH 1/4] chore: remove generated file (#416) --- examples/feature_fragments | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 examples/feature_fragments diff --git a/examples/feature_fragments b/examples/feature_fragments deleted file mode 100644 index 7d1b624770..0000000000 --- a/examples/feature_fragments +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - -} From 2abca938bf7e30918918798d221f18d0dd7aa66d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 21 May 2021 18:25:33 +0200 Subject: [PATCH 2/4] chore(deps): update dependency google-cloud-aiplatform to v1 (#415) --- samples/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 7581fe95ab..0c84038bd2 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1,3 +1,3 @@ pytest==6.2.4 google-cloud-storage>=1.26.0, <2.0.0dev -google-cloud-aiplatform==0.8.0 +google-cloud-aiplatform==1.0.0 From f40f32289e1fbeb93b35e4b66f65d15528a6481c Mon Sep 17 00:00:00 2001 From: sasha-gitg <44654632+sasha-gitg@users.noreply.github.com> Date: Fri, 21 May 2021 16:51:03 -0400 Subject: [PATCH 3/4] fix: use resource name location when passed full resource name (#421) --- google/cloud/aiplatform/base.py | 3 --- tests/unit/aiplatform/test_datasets.py | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/google/cloud/aiplatform/base.py b/google/cloud/aiplatform/base.py index f183c1aedc..07e4c2fe4a 100644 --- a/google/cloud/aiplatform/base.py +++ b/google/cloud/aiplatform/base.py @@ -501,9 +501,6 @@ def _get_and_validate_project_location( RuntimeError if location is different from resource location """ - if not project and not location: - return project, location - fields = utils.extract_fields_from_resource_name( resource_name, self._resource_noun ) diff --git a/tests/unit/aiplatform/test_datasets.py b/tests/unit/aiplatform/test_datasets.py index 6b67d67a20..4c2a75c393 100644 --- a/tests/unit/aiplatform/test_datasets.py +++ b/tests/unit/aiplatform/test_datasets.py @@ -31,6 +31,7 @@ from google.cloud import bigquery from google.cloud import storage +from google.cloud.aiplatform import compat from google.cloud.aiplatform import datasets from google.cloud.aiplatform import initializer from google.cloud.aiplatform import schema @@ -401,6 +402,20 @@ def test_init_dataset_with_alt_project_and_location(self, get_dataset_mock): ) get_dataset_mock.assert_called_once_with(name=_TEST_NAME) + def test_init_dataset_with_alt_location(self, get_dataset_tabular_gcs_mock): + aiplatform.init(project=_TEST_PROJECT, location=_TEST_ALT_LOCATION) + + ds = datasets.TabularDataset(dataset_name=_TEST_NAME) + + assert ( + ds.api_client._clients[compat.DEFAULT_VERSION]._client_options.api_endpoint + == f"{_TEST_LOCATION}-{aiplatform.constants.API_BASE_PATH}" + ) + + assert _TEST_ALT_LOCATION != _TEST_LOCATION + + get_dataset_tabular_gcs_mock.assert_called_once_with(name=_TEST_NAME) + def test_init_dataset_with_project_and_alt_location(self): aiplatform.init(project=_TEST_PROJECT) with pytest.raises(RuntimeError): From 987ce3ea16b9fef43b2edf966d75fd6e6518a5d8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 26 May 2021 12:38:58 -0400 Subject: [PATCH 4/4] chore: release 1.0.1 (#422) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb6c5f32b0..5fa4409fd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.0.1](https://www.github.com/googleapis/python-aiplatform/compare/v1.0.0...v1.0.1) (2021-05-21) + + +### Bug Fixes + +* use resource name location when passed full resource name ([#421](https://www.github.com/googleapis/python-aiplatform/issues/421)) ([f40f322](https://www.github.com/googleapis/python-aiplatform/commit/f40f32289e1fbeb93b35e4b66f65d15528a6481c)) + ## [1.0.0](https://www.github.com/googleapis/python-aiplatform/compare/v0.9.0...v1.0.0) (2021-05-19) diff --git a/setup.py b/setup.py index 6b11cfe2e3..d1cced2675 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ import setuptools # type: ignore name = "google-cloud-aiplatform" -version = "1.0.0" +version = "1.0.1" description = "Cloud AI Platform API client library" package_root = os.path.abspath(os.path.dirname(__file__))