2323
2424from asktable import Asktable , AsyncAsktable , APIResponseValidationError
2525from asktable ._types import Omit
26+ from asktable ._utils import maybe_transform
2627from asktable ._models import BaseModel , FinalRequestOptions
2728from asktable ._constants import RAW_RESPONSE_HEADER
2829from asktable ._exceptions import APIStatusError , APITimeoutError , APIResponseValidationError
3233 BaseClient ,
3334 make_request_options ,
3435)
36+ from asktable .types .datasource_create_params import DatasourceCreateParams
3537
3638from .utils import update_env
3739
@@ -707,7 +709,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No
707709 with pytest .raises (APITimeoutError ):
708710 self .client .post (
709711 "/datasources" ,
710- body = cast (object , dict (engine = "mysql" )),
712+ body = cast (object , maybe_transform ( dict (engine = "mysql" ), DatasourceCreateParams )),
711713 cast_to = httpx .Response ,
712714 options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }},
713715 )
@@ -722,7 +724,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non
722724 with pytest .raises (APIStatusError ):
723725 self .client .post (
724726 "/datasources" ,
725- body = cast (object , dict (engine = "mysql" )),
727+ body = cast (object , maybe_transform ( dict (engine = "mysql" ), DatasourceCreateParams )),
726728 cast_to = httpx .Response ,
727729 options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }},
728730 )
@@ -1477,7 +1479,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter)
14771479 with pytest .raises (APITimeoutError ):
14781480 await self .client .post (
14791481 "/datasources" ,
1480- body = cast (object , dict (engine = "mysql" )),
1482+ body = cast (object , maybe_transform ( dict (engine = "mysql" ), DatasourceCreateParams )),
14811483 cast_to = httpx .Response ,
14821484 options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }},
14831485 )
@@ -1492,7 +1494,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter)
14921494 with pytest .raises (APIStatusError ):
14931495 await self .client .post (
14941496 "/datasources" ,
1495- body = cast (object , dict (engine = "mysql" )),
1497+ body = cast (object , maybe_transform ( dict (engine = "mysql" ), DatasourceCreateParams )),
14961498 cast_to = httpx .Response ,
14971499 options = {"headers" : {RAW_RESPONSE_HEADER : "stream" }},
14981500 )
0 commit comments