Skip to content

Add various sdk test improvements: #1272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion tests/data/annotation_types/data/test_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_text():


def test_url():
url = "https://filesamples.com/samples/document/txt/sample3.txt"
url = "https://storage.googleapis.com/lb-artifacts-testing-public/sdk_integration_test/sample3.txt"
text_data = TextData(url=url)
text = text_data.value
assert len(text) == 3541
Expand Down
19 changes: 15 additions & 4 deletions tests/integration/test_data_rows.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,8 +964,8 @@ def test_data_row_bulk_creation_sync_with_same_global_keys(
assert list(dataset.data_rows())[0].global_key == global_key_1


@pytest.mark.skip(reason="create_data_rows_sync not supported by ADV yet")
def test_create_conversational_text(client, dataset, conversational_content):
@pytest.fixture
def converstational_data_rows(dataset, conversational_content):
examples = [
{
**conversational_content, 'media_type':
Expand All @@ -976,9 +976,20 @@ def test_create_conversational_text(client, dataset, conversational_content):
"conversationalData": conversational_content['row_data']['messages']
} # Old way to check for backwards compatibility
]
dataset.create_data_rows_sync(examples)
task = dataset.create_data_rows(examples)
task.wait_till_done()
assert task.status == "COMPLETE"

data_rows = list(dataset.data_rows())
assert len(data_rows) == len(examples)

yield data_rows
for dr in data_rows:
dr.delete()


def test_create_conversational_text(converstational_data_rows,
conversational_content):
data_rows = converstational_data_rows
for data_row in data_rows:
assert requests.get(
data_row.row_data).json() == conversational_content['row_data']
Expand Down