Skip to content

Commit

Permalink
bug: remove requirement for import_schema_uri when passing in gcs_sou…
Browse files Browse the repository at this point in the history
…rce (googleapis#46)
  • Loading branch information
sasha-gitg authored and dizcology committed Dec 22, 2020
1 parent cdc49fe commit 1ee6c92
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
6 changes: 0 additions & 6 deletions google/cloud/aiplatform/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,6 @@ def create(
Instantiated representation of the managed dataset resource.
"""

# Validate that source and import schema are passed together or not at all
if bool(gcs_source) ^ bool(import_schema_uri):
raise ValueError(
"Please provide both GCS source and import_schema_uri to import data or omit both."
)

is_tabular_dataset_metadata = (
metadata_schema_uri == schema.dataset.metadata.tabular
)
Expand Down
14 changes: 0 additions & 14 deletions tests/unit/aiplatform/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,20 +242,6 @@ def test_create_and_import_dataset(self, create_dataset_mock, import_data_mock):
expected_dataset.name = _TEST_NAME
assert my_dataset._gca_resource == expected_dataset

@pytest.mark.usefixtures("get_dataset_mock")
def test_create_and_import_dataset_without_import_schema_uri(
self, create_dataset_mock
):
with pytest.raises(ValueError):
aiplatform.init(project=_TEST_PROJECT)

Dataset.create(
display_name=_TEST_DISPLAY_NAME,
metadata_schema_uri=_TEST_METADATA_SCHEMA_URI_NONTABULAR,
labels=_TEST_LABEL,
gcs_source=_TEST_SOURCE_URI_GCS,
)

@pytest.mark.usefixtures("get_dataset_mock")
def test_import_data(self, import_data_mock):
aiplatform.init(project=_TEST_PROJECT)
Expand Down

0 comments on commit 1ee6c92

Please sign in to comment.