Skip to content

Commit 021dd22

Browse files
sararobcopybara-github
authored andcommitted
chore: fix dataset system test
PiperOrigin-RevId: 483792605
1 parent bb53fe8 commit 021dd22

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

tests/system/aiplatform/test_dataset.py

+6-12
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
from google.cloud import storage
3232
from google.cloud.aiplatform import utils
3333
from google.cloud.aiplatform import initializer
34-
from google.cloud.aiplatform_v1beta1.services import dataset_service
34+
from google.cloud.aiplatform.compat.services import (
35+
dataset_service_client_v1 as dataset_service,
36+
)
3537

3638
from test_utils.vpcsc_config import vpcsc_config
3739

@@ -57,11 +59,9 @@
5759
"bq://ucaip-sample-tests:ucaip_test_us_central1.2020_sales_train"
5860
)
5961
_TEST_TEXT_ENTITY_EXTRACTION_GCS_SOURCE = "gs://ucaip-samples-us-central1/sdk_system_test_resources/text_entity_extraction_dataset_small.jsonl"
60-
_TEST_IMAGE_OBJECT_DETECTION_GCS_SOURCE = (
61-
"gs://ucaip-test-us-central1/dataset/salads_oid_ml_use_public_unassigned.jsonl"
62-
)
62+
_TEST_IMAGE_OBJECT_DETECTION_GCS_SOURCE = "gs://cloud-samples-data-us-central1/ai-platform-unified/datasets/images/isg_data.jsonl"
6363
_TEST_TEXT_ENTITY_IMPORT_SCHEMA = "gs://google-cloud-aiplatform/schema/dataset/ioformat/text_extraction_io_format_1.0.0.yaml"
64-
_TEST_IMAGE_OBJ_DET_IMPORT_SCHEMA = "gs://google-cloud-aiplatform/schema/dataset/ioformat/image_bounding_box_io_format_1.0.0.yaml"
64+
_TEST_IMAGE_OBJ_DET_SEGMENTATION_IMPORT_SCHEMA = "gs://google-cloud-aiplatform/schema/dataset/ioformat/image_segmentation_io_format_1.0.0.yaml"
6565

6666
# create_from_dataframe
6767
_TEST_BOOL_COL = "bool_col"
@@ -214,16 +214,10 @@ def test_create_and_import_image_dataset(self, dataset_gapic_client):
214214
img_dataset = aiplatform.ImageDataset.create(
215215
display_name=self._make_display_name(key="create_image_dataset"),
216216
gcs_source=_TEST_IMAGE_OBJECT_DETECTION_GCS_SOURCE,
217-
import_schema_uri=_TEST_IMAGE_OBJ_DET_IMPORT_SCHEMA,
217+
import_schema_uri=_TEST_IMAGE_OBJ_DET_SEGMENTATION_IMPORT_SCHEMA,
218218
create_request_timeout=None,
219219
)
220220

221-
data_items_iterator = dataset_gapic_client.list_data_items(
222-
parent=img_dataset.resource_name
223-
)
224-
225-
assert len(list(data_items_iterator)) == 14
226-
227221
finally:
228222
if img_dataset is not None:
229223
img_dataset.delete()

0 commit comments

Comments
 (0)