Skip to content
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
4 changes: 2 additions & 2 deletions tests/api_resources/test_finetunings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Dataherald) -> None:
"model_provider": "model_provider",
},
db_connection_id="db_connection_id",
golden_sqls=["string", "string", "string"],
golden_sqls=["string"],
metadata={},
)
assert_matches_type(FinetuningResponse, finetuning, path=["response"])
Expand Down Expand Up @@ -202,7 +202,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncDataherald
"model_provider": "model_provider",
},
db_connection_id="db_connection_id",
golden_sqls=["string", "string", "string"],
golden_sqls=["string"],
metadata={},
)
assert_matches_type(FinetuningResponse, finetuning, path=["response"])
Expand Down
72 changes: 6 additions & 66 deletions tests/api_resources/test_golden_sqls.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,7 @@ def test_method_upload(self, client: Dataherald) -> None:
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
{
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
{
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
}
],
)
assert_matches_type(GoldenSqlUploadResponse, golden_sql, path=["response"])
Expand All @@ -164,17 +154,7 @@ def test_raw_response_upload(self, client: Dataherald) -> None:
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
{
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
{
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
}
],
)

Expand All @@ -191,17 +171,7 @@ def test_streaming_response_upload(self, client: Dataherald) -> None:
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
{
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
{
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
}
],
) as response:
assert not response.is_closed
Expand Down Expand Up @@ -336,17 +306,7 @@ async def test_method_upload(self, async_client: AsyncDataherald) -> None:
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
{
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
{
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
}
],
)
assert_matches_type(GoldenSqlUploadResponse, golden_sql, path=["response"])
Expand All @@ -359,17 +319,7 @@ async def test_raw_response_upload(self, async_client: AsyncDataherald) -> None:
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
{
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
{
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
}
],
)

Expand All @@ -386,17 +336,7 @@ async def test_streaming_response_upload(self, async_client: AsyncDataherald) ->
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
{
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
{
"db_connection_id": "db_connection_id",
"prompt_text": "prompt_text",
"sql": "sql",
},
}
],
) as response:
assert not response.is_closed
Expand Down
84 changes: 12 additions & 72 deletions tests/api_resources/test_table_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,17 @@ def test_method_update_with_all_params(self, client: Dataherald) -> None:
id="id",
columns=[
{
"categories": ["string", "string", "string"],
"categories": ["string"],
"data_type": "data_type",
"description": "description",
"foreign_key": {},
"is_primary_key": True,
"low_cardinality": True,
"name": "name",
},
{
"categories": ["string", "string", "string"],
"data_type": "data_type",
"description": "description",
"foreign_key": {},
"is_primary_key": True,
"low_cardinality": True,
"name": "name",
},
{
"categories": ["string", "string", "string"],
"data_type": "data_type",
"description": "description",
"foreign_key": {},
"is_primary_key": True,
"low_cardinality": True,
"name": "name",
},
}
],
description="description",
examples=[{}, {}, {}],
examples=[{}],
metadata={},
)
assert_matches_type(TableDescriptionResponse, table_description, path=["response"])
Expand Down Expand Up @@ -178,22 +160,14 @@ def test_streaming_response_list(self, client: Dataherald) -> None:
@parametrize
def test_method_sync_schemas(self, client: Dataherald) -> None:
table_description = client.table_descriptions.sync_schemas(
body=[
{"db_connection_id": "db_connection_id"},
{"db_connection_id": "db_connection_id"},
{"db_connection_id": "db_connection_id"},
],
body=[{"db_connection_id": "db_connection_id"}],
)
assert_matches_type(TableDescriptionSyncSchemasResponse, table_description, path=["response"])

@parametrize
def test_raw_response_sync_schemas(self, client: Dataherald) -> None:
response = client.table_descriptions.with_raw_response.sync_schemas(
body=[
{"db_connection_id": "db_connection_id"},
{"db_connection_id": "db_connection_id"},
{"db_connection_id": "db_connection_id"},
],
body=[{"db_connection_id": "db_connection_id"}],
)

assert response.is_closed is True
Expand All @@ -204,11 +178,7 @@ def test_raw_response_sync_schemas(self, client: Dataherald) -> None:
@parametrize
def test_streaming_response_sync_schemas(self, client: Dataherald) -> None:
with client.table_descriptions.with_streaming_response.sync_schemas(
body=[
{"db_connection_id": "db_connection_id"},
{"db_connection_id": "db_connection_id"},
{"db_connection_id": "db_connection_id"},
],
body=[{"db_connection_id": "db_connection_id"}],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand Down Expand Up @@ -273,35 +243,17 @@ async def test_method_update_with_all_params(self, async_client: AsyncDataherald
id="id",
columns=[
{
"categories": ["string", "string", "string"],
"categories": ["string"],
"data_type": "data_type",
"description": "description",
"foreign_key": {},
"is_primary_key": True,
"low_cardinality": True,
"name": "name",
},
{
"categories": ["string", "string", "string"],
"data_type": "data_type",
"description": "description",
"foreign_key": {},
"is_primary_key": True,
"low_cardinality": True,
"name": "name",
},
{
"categories": ["string", "string", "string"],
"data_type": "data_type",
"description": "description",
"foreign_key": {},
"is_primary_key": True,
"low_cardinality": True,
"name": "name",
},
}
],
description="description",
examples=[{}, {}, {}],
examples=[{}],
metadata={},
)
assert_matches_type(TableDescriptionResponse, table_description, path=["response"])
Expand Down Expand Up @@ -379,22 +331,14 @@ async def test_streaming_response_list(self, async_client: AsyncDataherald) -> N
@parametrize
async def test_method_sync_schemas(self, async_client: AsyncDataherald) -> None:
table_description = await async_client.table_descriptions.sync_schemas(
body=[
{"db_connection_id": "db_connection_id"},
{"db_connection_id": "db_connection_id"},
{"db_connection_id": "db_connection_id"},
],
body=[{"db_connection_id": "db_connection_id"}],
)
assert_matches_type(TableDescriptionSyncSchemasResponse, table_description, path=["response"])

@parametrize
async def test_raw_response_sync_schemas(self, async_client: AsyncDataherald) -> None:
response = await async_client.table_descriptions.with_raw_response.sync_schemas(
body=[
{"db_connection_id": "db_connection_id"},
{"db_connection_id": "db_connection_id"},
{"db_connection_id": "db_connection_id"},
],
body=[{"db_connection_id": "db_connection_id"}],
)

assert response.is_closed is True
Expand All @@ -405,11 +349,7 @@ async def test_raw_response_sync_schemas(self, async_client: AsyncDataherald) ->
@parametrize
async def test_streaming_response_sync_schemas(self, async_client: AsyncDataherald) -> None:
async with async_client.table_descriptions.with_streaming_response.sync_schemas(
body=[
{"db_connection_id": "db_connection_id"},
{"db_connection_id": "db_connection_id"},
{"db_connection_id": "db_connection_id"},
],
body=[{"db_connection_id": "db_connection_id"}],
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
Expand Down