Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions tests/integration/test_data_rows.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,19 +476,26 @@ def create_data_row(data_rows):
CUSTOM_TEXT_SCHEMA_NAME].uid


def test_create_data_rows_with_invalid_metadata(dataset, image_url):
def test_create_data_rows_with_invalid_metadata(dataset, image_url,
is_adv_enabled):
fields = make_metadata_fields()
# make the payload invalid by providing the same schema id more than once
fields.append(
DataRowMetadataField(schema_id=TEXT_SCHEMA_ID, value='some msg'))
DataRowMetadataField(schema_id=TEXT_SCHEMA_ID, value="some msg"))

task = dataset.create_data_rows([{
DataRow.row_data: image_url,
DataRow.metadata_fields: fields
}])
task.wait_till_done()
assert task.status == "FAILED"
assert len(task.failed_data_rows) > 0
task.wait_till_done(timeout_seconds=60)
if is_adv_enabled:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kkim-labelbox another difference in ADV
I documented this here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this because ADV partially fails now when there's an error with validation of metadata on one data row?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It partially succeeds instead. What can be imported, will be imported. The rest will be reported as failures.

assert task.status == "COMPLETE"
assert len(task.failed_data_rows) == 1
assert f"A schemaId can only be specified once per DataRow : [{TEXT_SCHEMA_ID}]" in task.failed_data_rows[
0]["message"]
else:
assert task.status == "FAILED"
assert len(task.failed_data_rows) > 0


def test_create_data_rows_with_metadata_missing_value(dataset, image_url):
Expand Down